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..9c80949b56b53acbb95c843edd100e44a7ebc9b2 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-blackbox-pattern.html |
@@ -0,0 +1,103 @@ |
+<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", {}, editBlackboxPatterns); |
+ |
+ var patterns = [ [{ |
+ regex: "bar\\.js" |
+ }, { |
+ regex: "baz\\.js" |
+ }], [{ |
+ hash: "3C0ADF012533AABFBB3711A5093951BBEE436E" |
+ }, { |
+ hash: "3C0ADF016AB340F1BB3711A4F41EBA0286FE40C" |
+ }]]; |
+ |
+ var actions = []; |
+ |
+ function editBlackboxPatterns() |
+ { |
+ var pattern = patterns.shift(); |
+ if (!pattern) { |
+ InspectorTest.completeTest(); |
+ return; |
+ } |
+ InspectorTest.log("Test pattern: " + JSON.stringify(pattern)); |
+ InspectorTest.sendCommandOrDie("Debugger.editBlackboxPatterns", { 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", {}, editBlackboxPatterns); |
+ 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> |