3 <script src=
"../../resources/js-test.js"></script>
4 <script src=
"resources/shared.js"></script>
9 description("Explicitly terminating worker with blocked call should allow later open calls to proceed");
14 if (self
.location
.search
!== "?second") {
21 function firstOpen() {
22 request
= evalAndLog("indexedDB.deleteDatabase(dbname)");
23 request
.onblocked
= unexpectedBlockedCallback
;
24 request
.onerror
= unexpectedErrorCallback
;
25 request
.onsuccess = function() {
26 request
= evalAndLog("indexedDB.open(dbname)");
27 request
.onblocked
= unexpectedBlockedCallback
;
28 request
.onerror
= unexpectedErrorCallback
;
29 request
.onsuccess
= startTheWorker
;
33 function secondOpen() {
34 request
= evalAndLog("indexedDB.open(dbname)");
35 request
.onblocked
= unexpectedBlockedCallback
;
36 request
.onerror
= unexpectedErrorCallback
;
37 request
.onupgradeneeded
= unexpectedUpgradeNeededCallback
;
38 request
.onsuccess = function() {
39 testPassed("Open worked after page reload.");
44 function startTheWorker()
46 worker
= startWorker("resources/pending-version-change-stuck.js?" + encodeURIComponent(dbname
));
47 worker
.onerror = function(e
) {
48 testFailed(e
.message
);
51 originalOnMessage
= worker
.onmessage
;
52 worker
.onmessage = function(event
) {
53 if (event
.data
== "gotblocked") {
55 self
.location
= self
.location
+ "?second";
59 originalOnMessage(event
);