summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/indexeddb/transaction-basics.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/storage/indexeddb/transaction-basics.html')
-rw-r--r--LayoutTests/storage/indexeddb/transaction-basics.html52
1 files changed, 51 insertions, 1 deletions
diff --git a/LayoutTests/storage/indexeddb/transaction-basics.html b/LayoutTests/storage/indexeddb/transaction-basics.html
index a7238f6..cea5d5d 100644
--- a/LayoutTests/storage/indexeddb/transaction-basics.html
+++ b/LayoutTests/storage/indexeddb/transaction-basics.html
@@ -8,6 +8,56 @@
<body>
<p id="description"></p>
<div id="console"></div>
-<script src="script-tests/transaction-basics.js"></script>
+<script>
+
+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;
+
+</script>
</body>
</html>