3 <script src=
"../../resources/js-test.js"></script>
4 <script src=
"resources/shared.js"></script>
9 description("No crashes when there are event listeners in a worker on shutdown");
11 if (self
.location
.search
== "?second") {
12 testPassed("Didn't crash!");
15 evalAndLog("workerGotBlocked = false");
16 evalAndLog("gotVersionChangeEvent = false");
17 indexedDBTest(prepareDatabase
, startTheWorker
);
20 function prepareDatabase()
22 debug("inside prepareDatabase");
24 db
= event
.target
.result
;
25 db
.onversionchange
= onVersionChange
;
28 function startTheWorker()
30 worker
= startWorker("resources/pending-version-change-on-exit.js?" + encodeURIComponent(dbname
));
31 realFinishJSTest
= finishJSTest
;
32 worker
.onerror = function(e
) {
33 testFailed(e
.message
);
36 finishJSTest = function() {
37 workerGotBlocked
= true;
42 function onVersionChange(e
)
44 gotVersionChangeEvent
= true;
48 function maybeReload()
50 if (gotVersionChangeEvent
&& workerGotBlocked
)
51 self
.location
= self
.location
+ "?second";