1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Verify that queuing up several commands works (and they all fire).");
8 indexedDBTest(prepareDatabase);
9 function prepareDatabase()
11 db = event.target.result;
12 event.target.transaction.onabort = unexpectedAbortCallback;
14 self.store = evalAndLog("db.createObjectStore('storeName')");
15 self.indexObject = evalAndLog("store.createIndex('indexName', 'x')");
17 request = evalAndLog("store.add({x: 'value', y: 'zzz'}, 'key')");
18 request.onsuccess = function() { verifyAdd(0); };
19 request.onerror = unexpectedErrorCallback;
21 request = evalAndLog("store.add({x: 'value2', y: 'zzz2'}, 'key2')");
22 request.onsuccess = function() { verifyAdd(1); };
23 request.onerror = unexpectedErrorCallback;
25 request = evalAndLog("store.put({x: 'valu2', y: 'zz2'}, 'ky2')");
26 request.onsuccess = function() { verifyAdd(2); };
27 request.onerror = unexpectedErrorCallback;
32 function verifyAdd(expected)
34 shouldBe("" + addCount++, "" + expected);
39 testFailed("Unexpected call to verifyAdd!");