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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-pattern.html

Issue 1754483002: [DevTools] Added setBlackboxPatterns method to protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@provide-hash-for-anonymous-scripts
Patch Set: Created 4 years, 9 months 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
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script>
5 function foo()
6 {
7 debugger;
8 return 239;
9 }
10 //# sourceURL=foo.js
11 </script>
12 <script>
13 function bar()
14 {
15 var a = 42;
16 var t = foo();
17 return a * t;
18 }
19 //# sourceURL=bar.js
20 </script>
21 <script>
22 function baz()
23 {
24 var a = 42;
25 var t = bar();
26 return a * t;
27 }
28 //# sourceURL=baz.js
29 </script>
30 <script>
31 function qwe()
32 {
33 var a = 42;
34 var t = baz();
35 return a * t;
36 }
37 </script>
38 <script>
39 function testFunction()
40 {
41 var a = qwe();
42 var c = qwe();
43 return a * c;
44 }
45 </script>
46 <script>
47
48 function test()
49 {
50 InspectorTest.eventHandler["Debugger.paused"] = runAction;
51 InspectorTest.eventHandler["Debugger.scriptParsed"] = function (messageObjec t) {
52 // InspectorTest.log(JSON.stringify(messageObject));
53 }
54 InspectorTest.sendCommandOrDie("Debugger.enable", {}, addBlackboxPatterns);
55
56 var patterns = [ [{
57 url: "bar.js"
58 }, {
59 url: "baz.js"
60 }, {
61 hash: "E787352377FB9E71BB7083A5DB0CA9FA9584E6F2"
62 }], [{
63 regexp: "ba(r|z)\\.js"
64 }, {
65 hash: "E787352377FB9E71BB7083A5DB0CA9FA9584E6F2"
66 }]];
67
68 var actions = [];
69
70 function addBlackboxPatterns()
71 {
72 var pattern = patterns.shift();
73 if (!pattern) {
74 InspectorTest.completeTest();
75 return;
76 }
77 InspectorTest.log("Test pattern: " + JSON.stringify(pattern));
78 InspectorTest.sendCommandOrDie("Debugger.addBlackboxPatterns", { pattern s: pattern }, callTestFunction);
79 }
80
81 function callTestFunction(response)
82 {
83 actions = [ "print", "stepOut", "print", "stepInto", "print" ];
84 InspectorTest.evaluateInInspectedPage("setTimeout(testFunction, 0);");
85 }
86
87 function runAction(response)
88 {
89 var action = actions.shift();
90 if (!action) {
91 InspectorTest.sendCommandOrDie("Debugger.resume", {}, addBlackboxPat terns);
92 return;
93 }
94
95 if (action === "print") {
96 printCallFrames(response.params.callFrames);
97 runAction({});
98 } else {
99 InspectorTest.log("action: " + action);
100 InspectorTest.sendCommandOrDie("Debugger." + action, {});
101 }
102 }
103
104 function printCallFrames(callFrames)
105 {
106 var topCallFrame = callFrames[0];
107 for (var callFrame of callFrames)
108 InspectorTest.log(callFrame.functionName + ': ' + callFrame.location .lineNumber + ":" + callFrame.location.columnNumber);
109 InspectorTest.log("");
110 }
111 }
112 </script>
113 </head>
114 <body onload="runTest()">
115 </body>
116 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698