| Index: third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-pattern.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-pattern.html b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-pattern.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ca3f3d57415fdcd31cf78dbc918ee0182be89ca9
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-pattern.html
|
| @@ -0,0 +1,107 @@
|
| +<html>
|
| +<head>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| +<script>
|
| +function foo()
|
| +{
|
| + debugger;
|
| + return 239;
|
| +}
|
| +//# sourceURL=foo.js
|
| +</script>
|
| +<script>
|
| +function bar()
|
| +{
|
| + var a = 42;
|
| + var t = foo();
|
| + return a * t;
|
| +}
|
| +//# sourceURL=bar.js
|
| +</script>
|
| +<script>
|
| +function baz()
|
| +{
|
| + var a = 42;
|
| + var t = bar();
|
| + return a * t;
|
| +}
|
| +//# sourceURL=baz.js
|
| +</script>
|
| +<script>
|
| +function testFunction()
|
| +{
|
| + var a = baz();
|
| + var c = baz();
|
| + return a * c;
|
| +}
|
| +</script>
|
| +<script>
|
| +
|
| +function test()
|
| +{
|
| + InspectorTest.eventHandler["Debugger.paused"] = runAction;
|
| + InspectorTest.sendCommandOrDie("Debugger.enable", {}, setBlackboxPatterns);
|
| +
|
| + var patterns = [ [{
|
| + type: "RegExp",
|
| + value: "bar\\.js"
|
| + }, {
|
| + type: "RegExp",
|
| + value: "baz\\.js"
|
| + }], [{
|
| + type: "Hash",
|
| + value: "3C0ADF012533AABFBB3711A5093951BBEE436E"
|
| + }, {
|
| + type: "Hash",
|
| + value: "3C0ADF016AB340F1BB3711A4F41EBA0286FE40C"
|
| + }]];
|
| +
|
| + var actions = [];
|
| +
|
| + function setBlackboxPatterns()
|
| + {
|
| + var pattern = patterns.shift();
|
| + if (!pattern) {
|
| + InspectorTest.completeTest();
|
| + return;
|
| + }
|
| + InspectorTest.log("Test pattern: " + JSON.stringify(pattern));
|
| + InspectorTest.sendCommandOrDie("Debugger.setBlackboxPatterns", { patterns: pattern }, callTestFunction);
|
| + }
|
| +
|
| + function callTestFunction(response)
|
| + {
|
| + actions = [ "print", "stepOut", "print", "stepInto", "print" ];
|
| + InspectorTest.evaluateInInspectedPage("setTimeout(testFunction, 0);");
|
| + }
|
| +
|
| + function runAction(response)
|
| + {
|
| + var action = actions.shift();
|
| + if (!action) {
|
| + InspectorTest.sendCommandOrDie("Debugger.resume", {}, setBlackboxPatterns);
|
| + return;
|
| + }
|
| +
|
| + if (action === "print") {
|
| + printCallFrames(response.params.callFrames);
|
| + runAction({});
|
| + } else {
|
| + InspectorTest.log("action: " + action);
|
| + InspectorTest.sendCommandOrDie("Debugger." + action, {});
|
| + }
|
| + }
|
| +
|
| + function printCallFrames(callFrames)
|
| + {
|
| + var topCallFrame = callFrames[0];
|
| + for (var callFrame of callFrames)
|
| + InspectorTest.log(callFrame.functionName + ': ' + callFrame.location.lineNumber + ":" + callFrame.location.columnNumber);
|
| + InspectorTest.log("");
|
| + }
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onload="runTest()">
|
| +</body>
|
| +</html>
|
|
|