3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
9 worker
= new Worker("resources/dedicated-worker-step-into.js");
10 worker
.onmessage = function(event
) { };
11 worker
.postMessage(1);
12 log("Started worker");
20 var workerRequestId
= 1;
21 function sendCommandToWorker(method
, params
)
23 InspectorTest
.sendCommand("Worker.sendMessageToWorker",
26 "message": JSON
.stringify({ "method": method
,
28 "id": workerRequestId
++ })
32 function didEnableWorkerDebugging(messageObject
)
34 if ("error" in messageObject
) {
35 InspectorTest
.log("FAIL: Couldn't enable worker debugger: " + messageObject
.error
.message
);
36 InspectorTest
.completeTest();
39 InspectorTest
.sendCommand("Worker.enable", {}, didEnableWorkerDebugging
);
40 InspectorTest
.sendCommand("Worker.setAutoconnectToWorkers", { "value": true });
41 InspectorTest
.sendCommand("Runtime.evaluate", { "expression": "startWorker()" });
43 InspectorTest
.eventHandler
["Worker.workerCreated"] = function(messageObject
)
45 workerId
= messageObject
["params"]["workerId"];
46 InspectorTest
.log("Worker created");
47 sendCommandToWorker("Debugger.enable", {});
48 sendCommandToWorker("Runtime.run", {});
52 InspectorTest
.eventHandler
["Worker.dispatchMessageFromWorker"] = function(messageObject
)
54 var message
= JSON
.parse(messageObject
["params"]["message"]);
55 if (message
["method"] === "Debugger.paused") {
56 InspectorTest
.log("SUCCESS: Worker paused");
57 if (++pauseCount
=== 1) {
58 InspectorTest
.log("Stepping into...");
59 sendCommandToWorker("Debugger.stepInto", {});
61 sendCommandToWorker("Debugger.disable", {});
62 InspectorTest
.completeTest();
70 <body onLoad=
"runTest();">
71 <p>Tests that dedicated worker won't crash on attempt to step into.
<a href=
"https://code.google.com/p/chromium/issues/detail?id=232392">Bug
232392.
</a>