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

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", {}, editBlackboxPatterns);
44
45 var patterns = [ [{
46 regex: "bar\\.js"
47 }, {
48 regex: "baz\\.js"
49 }], [{
50 hash: "3C0ADF012533AABFBB3711A5093951BBEE436E"
51 }, {
52 hash: "3C0ADF016AB340F1BB3711A4F41EBA0286FE40C"
53 }]];
54
55 var actions = [];
56
57 function editBlackboxPatterns()
58 {
59 var pattern = patterns.shift();
60 if (!pattern) {
61 InspectorTest.completeTest();
62 return;
63 }
64 InspectorTest.log("Test pattern: " + JSON.stringify(pattern));
65 InspectorTest.sendCommandOrDie("Debugger.editBlackboxPatterns", { patter ns: pattern }, callTestFunction);
66 }
67
68 function callTestFunction(response)
69 {
70 actions = [ "print", "stepOut", "print", "stepInto", "print" ];
71 InspectorTest.evaluateInInspectedPage("setTimeout(testFunction, 0);");
72 }
73
74 function runAction(response)
75 {
76 var action = actions.shift();
77 if (!action) {
78 InspectorTest.sendCommandOrDie("Debugger.resume", {}, editBlackboxPa tterns);
79 return;
80 }
81
82 if (action === "print") {
83 printCallFrames(response.params.callFrames);
84 runAction({});
85 } else {
86 InspectorTest.log("action: " + action);
87 InspectorTest.sendCommandOrDie("Debugger." + action, {});
88 }
89 }
90
91 function printCallFrames(callFrames)
92 {
93 var topCallFrame = callFrames[0];
94 for (var callFrame of callFrames)
95 InspectorTest.log(callFrame.functionName + ': ' + callFrame.location .lineNumber + ":" + callFrame.location.columnNumber);
96 InspectorTest.log("");
97 }
98 }
99 </script>
100 </head>
101 <body onload="runTest()">
102 </body>
103 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698