diff options
Diffstat (limited to 'LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html')
-rw-r--r-- | LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html index e842f5b..7878c7f 100644 --- a/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html +++ b/LayoutTests/storage/indexeddb/objectstore-removeobjectstore.html @@ -49,7 +49,11 @@ function getValue() { verifySuccessEvent(event); - result = evalAndLog("event.source.get('key')"); + transaction = evalAndLog("db.transaction()"); + transaction.onabort = unexpectedErrorCallback; + var store = evalAndLog("store = transaction.objectStore('storeName')"); + + result = evalAndLog("store.get('key')"); verifyResult(result); result.onsuccess = addIndex; result.onerror = unexpectedErrorCallback; @@ -62,15 +66,20 @@ function addIndex() result = evalAndLog("event.source.createIndex('indexName', '')"); verifyResult(result); - result.onsuccess = removeObjectStore; + result.onsuccess = commitTransaction; result.onerror = unexpectedErrorCallback; } -function removeObjectStore() +function commitTransaction() { verifySuccessEvent(event); shouldBeTrue("event.source.indexNames.contains('indexName')"); + // Let the transaction commit. + window.setTimeout('removeObjectStore()', 0); +} +function removeObjectStore() +{ result = evalAndLog("db.removeObjectStore('storeName')"); verifyResult(result); result.onsuccess = createObjectStoreAgain; @@ -91,7 +100,11 @@ function getValueAgain() { verifySuccessEvent(event); - result = evalAndLog("event.result.get('key')"); + transaction = evalAndLog("db.transaction()"); + transaction.onabort = unexpectedErrorCallback; + var store = evalAndLog("store = transaction.objectStore('storeName')"); + + result = evalAndLog("store.get('key')"); verifyResult(result); result.onsuccess = unexpectedSuccessCallback; result.onerror = verifyError; @@ -100,7 +113,6 @@ function getValueAgain() function verifyError() { verifyErrorEvent(event); - // FIXME: Should just be IDBDatabaseException.NOT_FOUND_ERR but that doesn't work yet. shouldBe("event.code", "2"); shouldBeFalse("event.source.indexNames.contains('indexName')"); |