1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("An open connection blocks a separate connection's setVersion call");
8 indexedDBTest(prepareDatabase, openAnother);
9 function prepareDatabase()
11 connection = event.target.result;
14 function openAnother()
16 openRequest = indexedDB.open(dbname, 2);
17 openRequest.onblocked = blocked;
18 openRequest.onupgradeneeded = inSetVersion;
21 seen_blocked_event = false;
24 evalAndLog("seen_blocked_event = true");
25 blocked_event = event;
26 shouldBe("blocked_event.oldVersion", "1");
27 shouldBe("blocked_event.newVersion", "2");
28 shouldEvaluateTo("blocked_event.target.readyState", "'pending'");
29 evalAndLog("connection.close()");
32 function inSetVersion()
34 debug("in setVersion.onsuccess");
35 shouldBeTrue("seen_blocked_event");
36 deleteAllObjectStores(connection);