summaryrefslogtreecommitdiffstats
path: root/LayoutTests/storage/indexeddb/script-tests
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/storage/indexeddb/script-tests')
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/database-basics.js1
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/database-description.js56
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/objectstore-basics.js3
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/open-cursor.js3
-rw-r--r--LayoutTests/storage/indexeddb/script-tests/transaction-basics.js47
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;