3 Any copyright is dedicated to the Public Domain.
4 http://creativecommons.org/publicdomain/zero/1.0/
6 <window title=
"Test for WorkerDebuggerGlobalScope.setImmediate"
7 xmlns=
"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
10 <script src=
"chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
11 <script src=
"chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
12 <script type=
"application/javascript" src=
"dom_worker_helper.js"/>
14 <script type=
"application/javascript">
17 const WORKER_URL =
"WorkerDebuggerGlobalScope.setImmediate_worker.js";
18 const DEBUGGER_URL = BASE_URL +
"WorkerDebuggerGlobalScope.setImmediate_debugger.js";
22 SimpleTest.waitForExplicitFinish();
24 let promise = waitForRegister(WORKER_URL, DEBUGGER_URL);
25 let worker = new Worker(WORKER_URL);
26 let dbg = await promise;
28 info(
"Send a request to the worker debugger. This should cause a " +
29 "the worker debugger to send two responses. The worker debugger " +
30 "should send the second response before the first one, since " +
31 "the latter is delayed until the next tick of the event loop.");
32 promise = waitForMultiple([
33 waitForDebuggerMessage(dbg,
"pong2"),
34 waitForDebuggerMessage(dbg,
"pong1")
36 dbg.postMessage(
"ping");
46 <body xmlns=
"http://www.w3.org/1999/xhtml">
48 <div id=
"content" style=
"display:none;"></div>
51 <label id=
"test-result"/>