diff options
Diffstat (limited to 'LayoutTests/storage/indexeddb/script-tests/database-basics.js')
-rw-r--r-- | LayoutTests/storage/indexeddb/script-tests/database-basics.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/LayoutTests/storage/indexeddb/script-tests/database-basics.js b/LayoutTests/storage/indexeddb/script-tests/database-basics.js new file mode 100644 index 0000000..a317b71 --- /dev/null +++ b/LayoutTests/storage/indexeddb/script-tests/database-basics.js @@ -0,0 +1,33 @@ +description("Test the basics of IndexedDB's IDBDatabase."); +if (window.layoutTestController) + layoutTestController.waitUntilDone(); + +function openSuccess() +{ + verifySuccessEvent(event); + + 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"); + shouldBe("db.objectStores.contains('')", "false"); + // FIXME: Test .item() once it's possible to get back a non-empty list. + + // FIXME: Test the other properties of IDBDatabase as they're written. + + done(); +} + +function test() +{ + result = evalAndLog("indexedDB.open('name', 'description')"); + verifyResult(result); + result.onsuccess = openSuccess; + result.onerror = unexpectedErrorCallback; +} + +test(); + +var successfullyParsed = true; |