1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Ensure that metadata remains correct when an aborted version change is followed by another. ");
10 request = evalAndLog("indexedDB.deleteDatabase(dbname)");
11 request.onblocked = unexpectedBlockedCallback;
12 request.onerror = unexpectedErrorCallback;
13 request.onsuccess = openConnection;
16 function openConnection()
19 evalAndLog("request = indexedDB.open(dbname, 2)");
20 request.onblocked = unexpectedBlockedCallback;
21 request.onsuccess = unexpectedSuccessCallback;
22 request.onupgradeneeded = onUpgradeNeeded;
23 request.onerror = onError;
26 function onUpgradeNeeded(evt)
29 evalAndLog("db = request.result");
30 shouldBe("db.version", "2");
31 evalAndLog("transaction = request.transaction");
33 evalAndLog("request = indexedDB.open(dbname, 3)");
34 request.onerror = unexpectedErrorCallback;
35 request.onupgradeneeded = onUpgradeNeeded2;
36 request.onsuccess = onSuccess;
38 evalAndLog("transaction.abort()");
44 shouldBe("db.version", "0");
47 function onUpgradeNeeded2(evt)
50 evalAndLog("db = request.result");
51 shouldBe("db.version", "3");
54 function onSuccess(evt)
57 evalAndLog("db = request.result");
58 shouldBe("db.version", "3");