OLD | NEW |
| (Empty) |
1 <html> | |
2 <head> | |
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/resource
s/inspector-protocol-test.js"></script> | |
4 <script> | |
5 function bar() | |
6 { | |
7 return 42; | |
8 } | |
9 </script> | |
10 <script> | |
11 function foo() | |
12 { | |
13 var a = bar(); | |
14 return a + 1; | |
15 } | |
16 //# sourceURL=foo.js | |
17 </script> | |
18 <script> | |
19 function qwe() | |
20 { | |
21 var a = foo(); | |
22 return a + 1; | |
23 } | |
24 //# sourceURL=qwe.js | |
25 </script> | |
26 <script> | |
27 function baz() | |
28 { | |
29 var a = qwe(); | |
30 return a + 1; | |
31 } | |
32 //# sourceURL=baz.js | |
33 </script> | |
34 <script> | |
35 function test() | |
36 { | |
37 InspectorTest.sendCommand("Debugger.enable", {}); | |
38 InspectorTest.sendCommand("Debugger.setBlackboxPatterns", { patterns: [ "foo
([" ] }, dumpError); | |
39 | |
40 function dumpError(message) | |
41 { | |
42 InspectorTest.log(message.error.message); | |
43 InspectorTest.eventHandler["Debugger.paused"] = dumpStackAndRunNextComma
nd; | |
44 InspectorTest.sendCommandOrDie("Debugger.setBlackboxPatterns", { pattern
s: [ "baz\.js", "foo\.js" ] }); | |
45 InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "debu
gger;baz()" }); | |
46 } | |
47 | |
48 var commands = [ "stepInto", "stepInto", "stepInto", "stepOut", "stepInto",
"stepInto" ]; | |
49 function dumpStackAndRunNextCommand(message) | |
50 { | |
51 InspectorTest.log("Paused in"); | |
52 var callFrames = message.params.callFrames; | |
53 for (var callFrame of callFrames) | |
54 InspectorTest.log((callFrame.functionName || "(...)") + ":" + (callF
rame.location.lineNumber + 1)); | |
55 var command = commands.shift(); | |
56 if (!command) { | |
57 InspectorTest.completeTest(); | |
58 return; | |
59 } | |
60 InspectorTest.sendCommandOrDie("Debugger." + command, {}); | |
61 } | |
62 | |
63 } | |
64 </script> | |
65 </head> | |
66 <body onLoad="runTest();"></body> | |
67 </html> | |
OLD | NEW |