diff options
author | Ben Murdoch <benm@google.com> | 2010-10-22 13:02:20 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-10-26 15:21:41 +0100 |
commit | a94275402997c11dd2e778633dacf4b7e630a35d (patch) | |
tree | e66f56c67e3b01f22c9c23cd932271ee9ac558ed /LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html | |
parent | 09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff) | |
download | external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2 |
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html')
-rw-r--r-- | LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html index 7878c7f..c4418bc 100644 --- a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html +++ b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html @@ -10,36 +10,46 @@ <div id="console"></div> <script> -description("Test IndexedDB's IDBObjectStore.removeObjectStore()."); +description("Test IndexedDB's webkitIDBObjectStore.removeObjectStore()."); if (window.layoutTestController) layoutTestController.waitUntilDone(); function test() { - result = evalAndLog("indexedDB.open('name', 'description')"); + result = evalAndLog("webkitIndexedDB.open('name', 'description')"); verifyResult(result); - result.onsuccess = createObjectStore; + result.onsuccess = startSetVersion; result.onerror = unexpectedErrorCallback; } -function createObjectStore() +function startSetVersion() { verifySuccessEvent(event); db = evalAndLog("db = event.result"); - deleteAllObjectStores(db); - - result = evalAndLog("db.createObjectStore('storeName', null)"); + result = evalAndLog("db.setVersion('new version')"); verifyResult(result); - result.onsuccess = addValue; + result.onsuccess = deleteExisting; result.onerror = unexpectedErrorCallback; } -function addValue() +function deleteExisting() { verifySuccessEvent(event); + window.trans = evalAndLog("trans = event.result"); + shouldBeTrue("trans !== null"); + + deleteAllObjectStores(db, createObjectStoreAndAddValue); +} + +function createObjectStoreAndAddValue() +{ + store = evalAndLog("store = db.createObjectStore('storeName', null)"); - result = evalAndLog("event.result.add('value', 'key')"); + window.index = evalAndLog("store.createIndex('indexName', '')"); + shouldBeTrue("store.indexNames.contains('indexName')"); + + result = evalAndLog("store.add('value', 'key')"); verifyResult(result); result.onsuccess = getValue; result.onerror = unexpectedErrorCallback; @@ -64,42 +74,31 @@ function addIndex() verifySuccessEvent(event); shouldBeEqualToString("event.result", "value"); - result = evalAndLog("event.source.createIndex('indexName', '')"); + result = evalAndLog("db.setVersion('new version')"); verifyResult(result); - result.onsuccess = commitTransaction; + result.onsuccess = removeObjectStore; result.onerror = unexpectedErrorCallback; } -function commitTransaction() +function removeObjectStore() { verifySuccessEvent(event); - shouldBeTrue("event.source.indexNames.contains('indexName')"); - // Let the transaction commit. - window.setTimeout('removeObjectStore()', 0); -} + window.trans = evalAndLog("trans = event.result"); + shouldBeTrue("trans !== null"); + trans.onabort = unexpectedAbortCallback; -function removeObjectStore() -{ - result = evalAndLog("db.removeObjectStore('storeName')"); - verifyResult(result); - result.onsuccess = createObjectStoreAgain; - result.onerror = unexpectedErrorCallback; + evalAndLog("db.removeObjectStore('storeName')"); + createObjectStoreAgain(); } function createObjectStoreAgain() { - verifySuccessEvent(event); - - result = evalAndLog("db.createObjectStore('storeName', null)"); - verifyResult(result); - result.onsuccess = getValueAgain; - result.onerror = unexpectedErrorCallback; + evalAndLog("db.createObjectStore('storeName', null)"); + getValueAgain(); } function getValueAgain() { - verifySuccessEvent(event); - transaction = evalAndLog("db.transaction()"); transaction.onabort = unexpectedErrorCallback; var store = evalAndLog("store = transaction.objectStore('storeName')"); |