diff options
author | Steve Block <steveblock@google.com> | 2010-08-27 11:02:25 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-09-02 17:17:20 +0100 |
commit | e8b154fd68f9b33be40a3590e58347f353835f5c (patch) | |
tree | 0733ce26384183245aaa5656af26c653636fe6c1 /LayoutTests/storage/indexeddb/script-tests | |
parent | da56157816334089526a7a115a85fd85a6e9a1dc (diff) | |
download | external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.zip external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.gz external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.bz2 |
Merge WebKit at r66079 : Initial merge by git
Change-Id: Ie2e1440fb9d487d24e52c247342c076fecaecac7
Diffstat (limited to 'LayoutTests/storage/indexeddb/script-tests')
5 files changed, 51 insertions, 59 deletions
diff --git a/LayoutTests/storage/indexeddb/script-tests/database-basics.js b/LayoutTests/storage/indexeddb/script-tests/database-basics.js index a317b71..a07c684 100644 --- a/LayoutTests/storage/indexeddb/script-tests/database-basics.js +++ b/LayoutTests/storage/indexeddb/script-tests/database-basics.js @@ -8,7 +8,6 @@ function openSuccess() var db = evalAndLog("db = event.result"); shouldBeEqualToString("db.name", "name"); - shouldBeEqualToString("db.description", "description"); shouldBeEqualToString("db.version", ""); shouldBe("db.objectStores", "[]"); shouldBe("db.objectStores.length", "0"); diff --git a/LayoutTests/storage/indexeddb/script-tests/database-description.js b/LayoutTests/storage/indexeddb/script-tests/database-description.js deleted file mode 100644 index bb4acba..0000000 --- a/LayoutTests/storage/indexeddb/script-tests/database-description.js +++ /dev/null @@ -1,56 +0,0 @@ -description("Test IDBFactory.open's description parameter."); -if (window.layoutTestController) - layoutTestController.waitUntilDone(); - -function test() -{ - shouldBeTrue("'indexedDB' in window"); - shouldBeFalse("indexedDB == null"); - - result = evalAndLog("indexedDB.open('abcd', 'first')"); - verifyResult(result); - result.onsuccess = firstSuccess; - result.onerror = unexpectedErrorCallback; -} - -function firstSuccess() -{ - verifySuccessEvent(event); - window.firstDB = event.result; - - shouldBeEqualToString('event.result.description', 'first'); - - result = evalAndLog("indexedDB.open('abcd', 'second')"); - verifyResult(result); - result.onsuccess = secondSuccess; - result.onerror = unexpectedErrorCallback; -} - -function secondSuccess() -{ - verifySuccessEvent(event); - window.secondDB = event.result; - - shouldBeEqualToString('firstDB.description', 'first'); - shouldBeEqualToString('secondDB.description', 'second'); - - result = evalAndLog("indexedDB.open('abcd')"); - verifyResult(result); - result.onsuccess = thirdSuccess; - result.onerror = unexpectedErrorCallback; -} - -function thirdSuccess() -{ - verifySuccessEvent(event); - - shouldBeEqualToString('firstDB.description', 'first'); - shouldBeEqualToString('secondDB.description', 'second'); - shouldBeEqualToString('event.result.description', 'second'); - - done(); -} - -test(); - -var successfullyParsed = true; diff --git a/LayoutTests/storage/indexeddb/script-tests/objectstore-basics.js b/LayoutTests/storage/indexeddb/script-tests/objectstore-basics.js index 9869579..63675ad 100644 --- a/LayoutTests/storage/indexeddb/script-tests/objectstore-basics.js +++ b/LayoutTests/storage/indexeddb/script-tests/objectstore-basics.js @@ -16,8 +16,7 @@ function openSuccess() verifySuccessEvent(event); db = evalAndLog("db = event.result"); - // FIXME: remove any previously created object stores. - // This requires IDBDatabaseRequest::removeObjectStore to be implemented. + deleteAllObjectStores(db); result = evalAndLog("db.createObjectStore('storeName', null)"); verifyResult(result); diff --git a/LayoutTests/storage/indexeddb/script-tests/open-cursor.js b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js index e3c615c..ff0b711 100644 --- a/LayoutTests/storage/indexeddb/script-tests/open-cursor.js +++ b/LayoutTests/storage/indexeddb/script-tests/open-cursor.js @@ -60,6 +60,9 @@ function openSuccess() { verifySuccessEvent(event); var db = evalAndLog("db = event.result"); + + deleteAllObjectStores(db); + result = evalAndLog("db.createObjectStore('test')"); verifyResult(result); result.onsuccess = createObjectStoreSuccess; diff --git a/LayoutTests/storage/indexeddb/script-tests/transaction-basics.js b/LayoutTests/storage/indexeddb/script-tests/transaction-basics.js new file mode 100644 index 0000000..58ac2a7 --- /dev/null +++ b/LayoutTests/storage/indexeddb/script-tests/transaction-basics.js @@ -0,0 +1,47 @@ +description("Test IndexedDB transaction basics."); +if (window.layoutTestController) + layoutTestController.waitUntilDone(); + +function test() +{ + shouldBeTrue("'indexedDB' in window"); + shouldBeFalse("indexedDB == null"); + + result = evalAndLog("indexedDB.open('name', 'description')"); + verifyResult(result); + result.onsuccess = openSuccess; + result.onerror = unexpectedErrorCallback; +} + +function openSuccess() +{ + debug("createObjectStoreCallback():"); + verifySuccessEvent(event); + db = evalAndLog("db = event.result"); + + deleteAllObjectStores(db); + + result = evalAndLog("db.createObjectStore('storeName', null)"); + verifyResult(result); + result.onsuccess = createSuccess; + result.onerror = unexpectedErrorCallback; +} + +function createSuccess() +{ + verifySuccessEvent(event); + transaction = evalAndLog("db.transaction()"); + transaction.onabort = abortCallback; + var store = evalAndLog("store = transaction.objectStore('storeName')"); + shouldBeEqualToString("store.name", "storeName"); +} + +function abortCallback() +{ + verifyAbortEvent(event); + done(); +} + +test(); + +var successfullyParsed = true; |