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

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 testFunction()
32 {
33 var a = baz();
34 var c = baz();
35 return a * c;
36 }
37 </script>
38 <script>
39
40 function test()
41 {
42 InspectorTest.eventHandler["Debugger.paused"] = runAction;
43 InspectorTest.sendCommandOrDie("Debugger.enable", {}, setBlackboxPatterns);
44
45 var patterns = [ [{
46 type: "RegExp",
47 value: "bar\\.js"
48 }, {
49 type: "RegExp",
50 value: "baz\\.js"
51 }], [{
52 type: "Hash",
53 value: "3C0ADF012533AABFBB3711A5093951BBEE436E"
54 }, {
55 type: "Hash",
56 value: "3C0ADF016AB340F1BB3711A4F41EBA0286FE40C"
57 }]];
58
59 var actions = [];
60
61 function setBlackboxPatterns()
62 {
63 var pattern = patterns.shift();
64 if (!pattern) {
65 InspectorTest.completeTest();
66 return;
67 }
68 InspectorTest.log("Test pattern: " + JSON.stringify(pattern));
69 InspectorTest.sendCommandOrDie("Debugger.setBlackboxPatterns", { pattern s: pattern }, callTestFunction);
70 }
71
72 function callTestFunction(response)
73 {
74 actions = [ "print", "stepOut", "print", "stepInto", "print" ];
75 InspectorTest.evaluateInInspectedPage("setTimeout(testFunction, 0);");
76 }
77
78 function runAction(response)
79 {
80 var action = actions.shift();
81 if (!action) {
82 InspectorTest.sendCommandOrDie("Debugger.resume", {}, setBlackboxPat terns);
83 return;
84 }
85
86 if (action === "print") {
87 printCallFrames(response.params.callFrames);
88 runAction({});
89 } else {
90 InspectorTest.log("action: " + action);
91 InspectorTest.sendCommandOrDie("Debugger." + action, {});
92 }
93 }
94
95 function printCallFrames(callFrames)
96 {
97 var topCallFrame = callFrames[0];
98 for (var callFrame of callFrames)
99 InspectorTest.log(callFrame.functionName + ': ' + callFrame.location .lineNumber + ":" + callFrame.location.columnNumber);
100 InspectorTest.log("");
101 }
102 }
103 </script>
104 </head>
105 <body onload="runTest()">
106 </body>
107 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698