Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/debugger-step-into-dedicated-worker.html

Issue 2442083002: [DevTools] Merge Worker domain to Target, migrate clients. (Closed)
Patch Set: rebased all tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script> 3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script> 4 <script>
5 var worker; 5 var worker;
6 6
7 function startWorker() 7 function startWorker()
8 { 8 {
9 worker = new Worker("resources/dedicated-worker-step-into.js"); 9 worker = new Worker("resources/dedicated-worker-step-into.js");
10 worker.onmessage = function(event) { }; 10 worker.onmessage = function(event) { };
11 worker.postMessage(1); 11 worker.postMessage(1);
12 log("Started worker"); 12 log("Started worker");
13 } 13 }
14 14
15 15
16 function test() 16 function test()
17 { 17 {
18 18
19 var workerId; 19 var workerId;
20 var workerRequestId = 1; 20 var workerRequestId = 1;
21 function sendCommandToWorker(method, params) 21 function sendCommandToWorker(method, params)
22 { 22 {
23 InspectorTest.sendCommand("Worker.sendMessageToWorker", 23 InspectorTest.sendCommand("Target.sendMessageToTarget",
24 { 24 {
25 "workerId": workerId, 25 "targetId": workerId,
26 "message": JSON.stringify({ "method": method, 26 "message": JSON.stringify({ "method": method,
27 "params": params, 27 "params": params,
28 "id": workerRequestId++ }) 28 "id": workerRequestId++ })
29 }); 29 });
30 } 30 }
31 31
32 function didEnableWorkerDebugging(messageObject) 32 function didEnableWorkerDebugging(messageObject)
33 { 33 {
34 if ("error" in messageObject) { 34 if ("error" in messageObject) {
35 InspectorTest.log("FAIL: Couldn't enable worker debugger: " + messag eObject.error.message); 35 InspectorTest.log("FAIL: Couldn't enable worker debugger: " + messag eObject.error.message);
36 InspectorTest.completeTest(); 36 InspectorTest.completeTest();
37 } 37 }
38 } 38 }
39 InspectorTest.sendCommand("Worker.enable", {}, didEnableWorkerDebugging); 39 InspectorTest.sendCommand("Target.setAutoAttach", {autoAttach: true, waitFor DebuggerOnStart: true}, didEnableWorkerDebugging);
40 InspectorTest.sendCommand("Worker.setWaitForDebuggerOnStart", { "value": tru e });
41 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "startWorker() " }); 40 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "startWorker() " });
42 41
43 InspectorTest.eventHandler["Worker.workerCreated"] = function(messageObject) 42 InspectorTest.eventHandler["Target.attachedToTarget"] = function(messageObje ct)
44 { 43 {
45 workerId = messageObject["params"]["workerId"]; 44 workerId = messageObject["params"]["targetInfo"]["targetId"];
46 InspectorTest.log("Worker created"); 45 InspectorTest.log("Worker created");
47 sendCommandToWorker("Debugger.enable", {}); 46 sendCommandToWorker("Debugger.enable", {});
48 sendCommandToWorker("Runtime.runIfWaitingForDebugger", {}); 47 sendCommandToWorker("Runtime.runIfWaitingForDebugger", {});
49 } 48 }
50 49
51 var pauseCount = 0; 50 var pauseCount = 0;
52 InspectorTest.eventHandler["Worker.dispatchMessageFromWorker"] = function(me ssageObject) 51 InspectorTest.eventHandler["Target.receivedMessageFromTarget"] = function(me ssageObject)
53 { 52 {
54 var message = JSON.parse(messageObject["params"]["message"]); 53 var message = JSON.parse(messageObject["params"]["message"]);
55 if (message["method"] === "Debugger.paused") { 54 if (message["method"] === "Debugger.paused") {
56 InspectorTest.log("SUCCESS: Worker paused"); 55 InspectorTest.log("SUCCESS: Worker paused");
57 if (++pauseCount === 1) { 56 if (++pauseCount === 1) {
58 InspectorTest.log("Stepping into..."); 57 InspectorTest.log("Stepping into...");
59 sendCommandToWorker("Debugger.stepInto", {}); 58 sendCommandToWorker("Debugger.stepInto", {});
60 } else { 59 } else {
61 sendCommandToWorker("Debugger.disable", {}); 60 sendCommandToWorker("Debugger.disable", {});
62 InspectorTest.completeTest(); 61 InspectorTest.completeTest();
63 } 62 }
64 } 63 }
65 } 64 }
66 65
67 } 66 }
68 </script> 67 </script>
69 </head> 68 </head>
70 <body onLoad="runTest();"> 69 <body onLoad="runTest();">
71 <p>Tests that dedicated worker won't crash on attempt to step into.<a href="http s://code.google.com/p/chromium/issues/detail?id=232392">Bug 232392.</a> 70 <p>Tests that dedicated worker won't crash on attempt to step into.<a href="http s://code.google.com/p/chromium/issues/detail?id=232392">Bug 232392.</a>
72 </p> 71 </p>
73 </body> 72 </body>
74 </html> 73 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698