1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Test that an abort in the initial upgradeneeded sets version back to 0");
12 request = evalAndLog("indexedDB.deleteDatabase(dbname)");
13 request.onsuccess = deleteSuccess;
14 request.onerror = unexpectedErrorCallback;
17 function deleteSuccess() {
18 request = evalAndLog("indexedDB.open(dbname, 2)");
19 request.onsuccess = unexpectedSuccessCallback;
20 evalAndLog("request.onupgradeneeded = upgradeNeeded");
21 evalAndLog("request.onerror = onError");
22 request.onblocked = unexpectedBlockedCallback;
25 function upgradeNeeded(evt)
28 db = event.target.result;
29 shouldBe("db.version", "2");
30 transaction = event.target.transaction;
31 transaction.oncomplete = unexpectedCompleteCallback;
32 transaction.onabort = onAbort;
33 evalAndLog("transaction.abort()");
39 shouldBe("event.target.db.version", "0");
40 shouldBeNonNull("request.transaction");
46 shouldBe("request", "event.target");
47 shouldBeUndefined("event.target.result");
48 shouldBeNonNull("event.target.error");
49 shouldBeEqualToString("event.target.error.name", "AbortError");
50 shouldBeNull("request.transaction");