Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector-protocol/debugger/debugger-setBlackboxPatterns.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/debugger-setBlackboxPatterns.html b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/debugger-setBlackboxPatterns.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..da98d6a854b44dd940383c410d3b16ca3ce27e39 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/debugger-setBlackboxPatterns.html |
| @@ -0,0 +1,67 @@ |
| +<html> |
| +<head> |
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script> |
| +<script> |
| +function bar() |
| +{ |
| + return 42; |
| +} |
| +</script> |
| +<script> |
| +function foo() |
| +{ |
| + var a = bar(); |
| + return a + 1; |
| +} |
| +//# sourceURL=foo.js |
| +</script> |
| +<script> |
| +function qwe() |
| +{ |
| + var a = foo(); |
| + return a + 1; |
| +} |
| +//# sourceURL=qwe.js |
| +</script> |
| +<script> |
| +function baz() |
| +{ |
| + var a = qwe(); |
| + return a + 1; |
| +} |
| +//# sourceURL=baz.js |
| +</script> |
| +<script> |
| +function test() |
| +{ |
| + InspectorTest.sendCommand("Debugger.enable", {}); |
| + InspectorTest.sendCommand("Debugger.setBlackboxPatterns", { patterns: [ "foo([" ] }, dumpError); |
|
dgozman
2016/04/20 02:06:39
Let's add inspector test which:
- sets the blackbo
|
| + |
| + function dumpError(message) |
| + { |
| + InspectorTest.log(message.error.message); |
| + InspectorTest.eventHandler["Debugger.paused"] = dumpStackAndRunNextCommand; |
| + InspectorTest.sendCommandOrDie("Debugger.setBlackboxPatterns", { patterns: [ "baz\.js", "foo\.js" ] }); |
| + InspectorTest.sendCommandOrDie("Runtime.evaluate", { "expression": "debugger;baz()" }); |
| + } |
| + |
| + var commands = [ "stepInto", "stepInto", "stepInto", "stepOut", "stepOut" ]; |
|
dgozman
2016/04/20 02:06:39
Let's change last stepOut to stepIn.
|
| + function dumpStackAndRunNextCommand(message) |
| + { |
| + InspectorTest.log("Paused in"); |
| + var callFrames = message.params.callFrames; |
| + for (var callFrame of callFrames) |
| + InspectorTest.log((callFrame.functionName || "(...)") + ":" + (callFrame.location.lineNumber + 1)); |
| + var command = commands.shift(); |
| + if (!command) { |
| + InspectorTest.completeTest(); |
| + return; |
| + } |
| + InspectorTest.sendCommandOrDie("Debugger." + command, {}); |
| + } |
| + |
| +} |
| +</script> |
| +</head> |
| +<body onLoad="runTest();"></body> |
| +</html> |