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..2492eff51ddc19065448c6f9378c1444c89627f3 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-pattern.html |
@@ -0,0 +1,116 @@ |
+<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 qwe() |
+{ |
+ var a = 42; |
+ var t = baz(); |
+ return a * t; |
+} |
+</script> |
+<script> |
+function testFunction() |
+{ |
+ var a = qwe(); |
+ var c = qwe(); |
+ return a * c; |
+} |
+</script> |
+<script> |
+ |
+function test() |
+{ |
+ InspectorTest.eventHandler["Debugger.paused"] = runAction; |
+ InspectorTest.eventHandler["Debugger.scriptParsed"] = function (messageObject) { |
+ // InspectorTest.log(JSON.stringify(messageObject)); |
+ } |
+ InspectorTest.sendCommandOrDie("Debugger.enable", {}, addBlackboxPatterns); |
+ |
+ var patterns = [ [{ |
+ url: "bar.js" |
+ }, { |
+ url: "baz.js" |
+ }, { |
+ hash: "E787352377FB9E71BB7083A5DB0CA9FA9584E6F2" |
+ }], [{ |
+ regexp: "ba(r|z)\\.js" |
+ }, { |
+ hash: "E787352377FB9E71BB7083A5DB0CA9FA9584E6F2" |
+ }]]; |
+ |
+ var actions = []; |
+ |
+ function addBlackboxPatterns() |
+ { |
+ var pattern = patterns.shift(); |
+ if (!pattern) { |
+ InspectorTest.completeTest(); |
+ return; |
+ } |
+ InspectorTest.log("Test pattern: " + JSON.stringify(pattern)); |
+ InspectorTest.sendCommandOrDie("Debugger.addBlackboxPatterns", { 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", {}, addBlackboxPatterns); |
+ 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> |