Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-protocol / debugger / suspend-setTimeout-on-pause-in-dedicated-worker.html
blobc2929a3e00994149c66dfaf44b8171ea5af20074
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script>
5 var worker;
7 function startWorker()
9 worker = new Worker("resources/dedicated-worker-suspend-setTimeout.js");
10 worker.onmessage = function(event) { };
11 worker.postMessage(1);
12 log("Started worker");
16 function test()
19 var workerId;
20 var workerRequestId = 1;
21 function sendCommandToWorker(method, params)
23 var requestId = workerRequestId++;
24 InspectorTest.sendCommand("Worker.sendMessageToWorker",
26 "workerId": workerId,
27 "message": JSON.stringify({ "method": method,
28 "params": params,
29 "id": requestId })
30 });
31 return requestId;
34 function didEnableWorkerDebugging(messageObject)
36 if ("error" in messageObject) {
37 InspectorTest.log("FAIL: Couldn't enable worker debugger: " + messageObject.error.message);
38 InspectorTest.completeTest();
41 InspectorTest.sendCommand("Worker.enable", {}, didEnableWorkerDebugging);
42 InspectorTest.sendCommand("Worker.setAutoconnectToWorkers", { "value": true });
43 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "startWorker()" });
45 InspectorTest.eventHandler["Worker.workerCreated"] = function(messageObject)
47 workerId = messageObject["params"]["workerId"];
48 InspectorTest.log("Worker created");
49 sendCommandToWorker("Debugger.enable", {});
50 sendCommandToWorker("Runtime.run", {});
53 var pauseCount = 0;
54 var evalRequestId;
55 InspectorTest.eventHandler["Worker.dispatchMessageFromWorker"] = function(messageObject)
57 var message = JSON.parse(messageObject["params"]["message"]);
58 if (message["method"] === "Debugger.paused") {
59 InspectorTest.log("SUCCESS: Worker paused");
60 if (++pauseCount === 1) {
61 evalRequestId = sendCommandToWorker("Runtime.evaluate", { "expression": "global_value" });
62 } else {
63 InspectorTest.log("FAIL: debugger paused second time");
64 InspectorTest.completeTest();
66 } else if (evalRequestId && message["id"] === evalRequestId) {
67 var value = message["result"]["result"]["value"];
68 if (value === 1)
69 InspectorTest.log("SUCCESS: global_value is 1");
70 else
71 InspectorTest.log("FAIL: setTimeout callback fired while script execution was paused");
72 sendCommandToWorker("Debugger.disable", {});
73 InspectorTest.completeTest();
77 </script>
78 </head>
79 <body onLoad="runTest();">
80 <p>Tests that setTimeout callback will not fire while script execution is paused.<a href="https://code.google.com/p/chromium/issues/detail?id=377926">Bug 377926.</a>
81 </p>
82 </body>
83 </html>