3 <script src=
"../../resources/js-test.js"></script>
4 <script src=
"resources/shared.js"></script>
9 description("Implicitly terminating worker with blocked setVersion call should allow later open calls to proceed");
13 dbname
= self
.location
.pathname
.substring(1 + self
.location
.pathname
.lastIndexOf("/"));
14 evalAndLog("request = indexedDB.open(\"" + dbname
+ "\")");
15 request
.onblocked
= unexpectedBlockedCallback
;
16 request
.onerror
= unexpectedErrorCallback
;
17 if (self
.location
.search
== "?second") {
18 request
.onsuccess = function() {
19 testPassed("Open worked after page reload.");
23 request
.onsuccess
= startTheWorker
;
27 function startTheWorker()
29 worker
= startWorker("resources/pending-version-change-stuck.js?" + encodeURI(dbname
));
30 worker
.onerror = function(e
) {
31 testFailed(e
.message
);
34 originalOnMessage
= worker
.onmessage
;
35 worker
.onmessage = function(event
) {
36 if (event
.data
== "gotblocked")
37 self
.location
= self
.location
+ "?second";
39 originalOnMessage(event
);