diff options
author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:42:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-10-07 10:59:29 +0100 |
commit | bec39347bb3bb5bf1187ccaf471d26247f28b585 (patch) | |
tree | 56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /LayoutTests/storage/indexeddb/objectstore-basics.html | |
parent | 90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff) | |
download | external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2 |
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'LayoutTests/storage/indexeddb/objectstore-basics.html')
-rw-r--r-- | LayoutTests/storage/indexeddb/objectstore-basics.html | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics.html b/LayoutTests/storage/indexeddb/objectstore-basics.html index 731d421..b2d383a 100644 --- a/LayoutTests/storage/indexeddb/objectstore-basics.html +++ b/LayoutTests/storage/indexeddb/objectstore-basics.html @@ -49,6 +49,16 @@ function createSuccess() shouldBe("storeNames.length", "1"); // FIXME: test all of object store's methods. + debug("Ask for a store that doesn't exist:"); + try { + index = evalAndLog("index = store.index('asdf')"); + shouldBeNull("index"); // Returning null is wrong, but less wrong than returning an actual object! + testFailed("Asking for a store that doesn't exist should have thrown."); + } catch (err) { + testPassed("Error thrown."); + // FIXME: Verify the correct exception thrown. + } + result = evalAndLog("event.result.createIndex('indexName', 'x', true)"); // true == unique requirement. verifyResult(result); result.onsuccess = addIndexSuccess; @@ -59,7 +69,20 @@ function addIndexSuccess() { debug("addIndexSuccess():"); verifySuccessEvent(event); + shouldBeTrue("event.result !== null"); shouldBeTrue("event.source.indexNames.contains('indexName')"); + index = evalAndLog("index = event.source.index('indexName')"); + shouldBeTrue("index !== null"); + + debug("Ask for a store that doesn't exist:"); + try { + index = evalAndLog("index = store.index('asdf')"); + shouldBeNull("index"); // Returning null is wrong, but less wrong than returning an actual object! + testFailed("Asking for a store that doesn't exist should have thrown."); + } catch (err) { + testPassed("Error thrown."); + // FIXME: Verify the correct exception thrown. + } result = evalAndLog("event.source.add({x: 'value'}, 'key')"); verifyResult(result); @@ -85,7 +108,10 @@ function addAgainFailure() verifyErrorEvent(event); // FIXME: This error code needs to be specced. shouldBe("event.code", "IDBDatabaseException.UNKNOWN_ERR"); - var store = evalAndLog("store = event.source"); + + transaction = evalAndLog("db.transaction()"); + transaction.onabort = unexpectedErrorCallback; + var store = evalAndLog("store = transaction.objectStore('storeName')"); result = evalAndLog("store.get('key')"); verifyResult(result); |