1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Test that setVersion is not blocked if handle closed in versionchange handler.");
8 indexedDBTest(prepareDatabase, onOpen);
9 evalAndLog("versionchangeEventFired = false");
10 function prepareDatabase(evt)
13 evalAndLog("h1 = event.target.result");
14 evalAndLog("h1.onversionchange = h1OnVersionChange");
17 function h1OnVersionChange(evt)
20 evalAndLog("versionchangeEventFired = true");
21 shouldBe("event.oldVersion", "1");
22 shouldBe("event.newVersion", "2");
23 evalAndLog("h1.close()");
28 request = evalAndLog("indexedDB.open(dbname, 2)");
29 request.onerror = unexpectedErrorCallback;
30 request.onblocked = unexpectedBlockedCallback;
31 request.onupgradeneeded = function h2UpgradeNeeded(evt) {
33 shouldBe("event.oldVersion", "1");
34 shouldBe("event.newVersion", "2");
36 request.onsuccess = function h2OpenSuccess(evt) {
38 shouldBeTrue("versionchangeEventFired");