1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Regression test for IDBRequest issue calling continue on a cursor then aborting.");
8 indexedDBTest(prepareDatabase, testCursor);
9 function prepareDatabase()
11 db = event.target.result;
12 event.target.transaction.onabort = unexpectedAbortCallback;
13 evalAndLog("db.createObjectStore('store')");
21 evalAndLog("transaction = db.transaction('store', 'readwrite')");
23 evalAndLog("store = transaction.objectStore('store')");
24 request = evalAndLog("store.add('value1', 'key1')");
25 request.onerror = unexpectedErrorCallback;
26 request = evalAndLog("store.add('value2', 'key2')");
27 request.onerror = unexpectedErrorCallback;
30 evalAndLog("state = 0");
31 evalAndLog("request = store.openCursor()");
32 request.onsuccess = function() {
34 debug("'success' event fired at request.");
35 shouldBe("++state", "1");
36 evalAndLog("request.result.continue()");
39 request.onerror = function() {
41 debug("'error' event fired at request.");
42 shouldBe("++state", "2");
44 transaction.oncomplete = unexpectedCompleteCallback;
45 transaction.onabort = function() {
47 debug("'abort' event fired at transaction.");
48 shouldBe("++state", "3");