mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 12:20:56 +00:00
Bug 1450416 - setTimeout/setInterval should silently fail if the worker is shutting down, r=asuth
This commit is contained in:
parent
0b49219fad
commit
3797da27ff
@ -4578,8 +4578,7 @@ WorkerPrivate::SetTimeout(JSContext* aCx,
|
||||
// If the worker is trying to call setTimeout/setInterval and the parent
|
||||
// thread has initiated the close process then just silently fail.
|
||||
if (currentStatus >= Closing) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return 0;
|
||||
return timerId;
|
||||
}
|
||||
|
||||
nsAutoPtr<TimeoutInfo> newInfo(new TimeoutInfo());
|
||||
|
@ -364483,6 +364483,12 @@
|
||||
{}
|
||||
]
|
||||
],
|
||||
"workers/interfaces/WorkerUtils/WindowTimers/005.html": [
|
||||
[
|
||||
"/workers/interfaces/WorkerUtils/WindowTimers/005.html",
|
||||
{}
|
||||
]
|
||||
],
|
||||
"workers/interfaces/WorkerUtils/importScripts/001.worker.js": [
|
||||
[
|
||||
"/workers/interfaces/WorkerUtils/importScripts/001.worker.html",
|
||||
@ -599516,6 +599522,10 @@
|
||||
"12d12036aa5937ae79aa152468cc574ac4bf4e94",
|
||||
"testharness"
|
||||
],
|
||||
"workers/interfaces/WorkerUtils/WindowTimers/005.html": [
|
||||
"11f0d7b6ea4a3c883d6c5cc8bde52c8ae9f7091b",
|
||||
"testharness"
|
||||
],
|
||||
"workers/interfaces/WorkerUtils/importScripts/001.worker.js": [
|
||||
"138e3be5d6375c8a784faabb4f2f4c82c2423bc3",
|
||||
"testharness"
|
||||
|
@ -1,6 +0,0 @@
|
||||
[setInterval.html]
|
||||
disabled:
|
||||
if debug: unstable
|
||||
[close() and setInterval]
|
||||
expected: FAIL
|
||||
|
@ -1,6 +0,0 @@
|
||||
[setTimeout.html]
|
||||
disabled:
|
||||
if debug: unstable
|
||||
[close() and setTimeout]
|
||||
expected: FAIL
|
||||
|
@ -0,0 +1,23 @@
|
||||
<!--
|
||||
self.close();
|
||||
var t = setInterval(function() {}, 10);
|
||||
postMessage(t);
|
||||
/*
|
||||
-->
|
||||
<!doctype html>
|
||||
<title>setInterval when closing</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<div id=log></div>
|
||||
<script>
|
||||
async_test(function() {
|
||||
var worker = new Worker('#');
|
||||
worker.onmessage = this.step_func(function(e) {
|
||||
assert_equals(e.data, 1);
|
||||
this.done();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!--
|
||||
*/
|
||||
//-->
|
Loading…
x
Reference in New Issue
Block a user