1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Check processing of pending version change requests - increasing versions.");
8 indexedDBTest(null, function onConnection1Open(evt) {
10 db = event.target.result;
12 request = evalAndLog("indexedDB.open(dbname, 2)");
13 request.onblocked = connection2Blocked;
14 request.onupgradeneeded = connection2UpgradeNeeded;
15 request.onsuccess = connection2OpenSuccess;
16 request.onerror = unexpectedErrorCallback;
18 request = evalAndLog("indexedDB.open(dbname, 3)");
19 request.onblocked = connection3Blocked;
20 request.onupgradeneeded = connection3UpgradeNeeded;
21 request.onsuccess = connection3OpenSuccess;
22 request.onerror = unexpectedErrorCallback;
25 debug("FIXME: The open call with higher version should execute first.");
28 function connection2Blocked(evt)
31 // Attempt to delay this until the third open has been processed;
32 // not strictly necessary but will exercise IPC/event timing.
33 setTimeout(function() {
34 evalAndLog("db.close()");
38 function connection2UpgradeNeeded(evt)
41 shouldBe("event.oldVersion", "1");
42 shouldBe("event.newVersion", "2");
45 function connection2OpenSuccess(evt)
48 evalAndLog("db2 = event.target.result");
49 shouldBe("db2.version", "2");
52 function connection3Blocked(evt)
55 evalAndLog("db2.close()");
58 function connection3UpgradeNeeded(evt)
61 shouldBe("event.oldVersion", "2");
62 shouldBe("event.newVersion", "3");
65 function connection3OpenSuccess(evt)
68 evalAndLog("db3 = event.target.result");
69 shouldBe("db3.version", "3");