| Index: third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-source-map-and-blackboxing.html
|
| diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-source-map-and-blackboxing.html b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-source-map-and-blackboxing.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..54613cc21b72f22a4f45233dba405aaa2b9e37b3
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-source-map-and-blackboxing.html
|
| @@ -0,0 +1,87 @@
|
| +<html>
|
| +<head>
|
| +<script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
|
| +<script type="text/javascript" src="resources/framework-with-sourcemap.js"></script>
|
| +<script>
|
| +function boo()
|
| +{
|
| + return 239;
|
| +}
|
| +
|
| +function testFunction()
|
| +{
|
| + debugger;
|
| + foo(boo);
|
| +}
|
| +
|
| +function test()
|
| +{
|
| + var actions = [ "stepInto", "stepInto", "stepOut" ];
|
| +
|
| + var sourceMap = {
|
| + version: 3,
|
| + sources: [ "foo.js" ],
|
| + names: [],
|
| + mappings: ";;AAAA,SAAS,GAAG,CAAC,GAAG,EAChB;AACI,QAAI,CAAC,GAAG,EAAE,CAAC;AACX,QAAI,GAAG,GAAG,GAAG,EAAE,CAAC;AAChB,WAAO,CAAE,GAAG,CAAC;CAChB"
|
| + };
|
| +
|
| + InspectorTest.eventHandler["Debugger.paused"] = printStackTraceAndMakeNextStep;
|
| + InspectorTest.eventHandler["Debugger.scriptParsed"] = scriptParsed;
|
| + InspectorTest.sendCommand("Debugger.enable");
|
| +
|
| + function scriptParsed(response)
|
| + {
|
| + failIfError(response);
|
| +
|
| + if (response.params.url.endsWith("/framework-with-sourcemap.js"))
|
| + setSourceMapContent(response.params.scriptId);
|
| + }
|
| +
|
| + function setSourceMapContent(scriptId)
|
| + {
|
| + InspectorTest.sendCommand("Debugger.setSourceMapContent", {
|
| + scriptId: scriptId,
|
| + content: JSON.stringify(sourceMap)
|
| + }, setSkipStackFrames);
|
| + }
|
| +
|
| + function setSkipStackFrames(response)
|
| + {
|
| + failIfError(response);
|
| + InspectorTest.sendCommand("Debugger.skipStackFrames", { script: "foo\\.js$"}, callTestFunction);
|
| + }
|
| +
|
| + function callTestFunction(response)
|
| + {
|
| + failIfError(response);
|
| + InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeout(testFunction, 0)"});
|
| + }
|
| +
|
| + function printStackTraceAndMakeNextStep(response)
|
| + {
|
| + failIfError(response);
|
| + var callFrames = response.params.callFrames;
|
| + InspectorTest.log("Stack trace:")
|
| + for (var callFrame of callFrames)
|
| + InspectorTest.log(callFrame.functionName + ":" + callFrame.functionLocation.lineNumber + ":" + callFrame.functionLocation.columnNumber);
|
| +
|
| + var action = actions.shift();
|
| + if (!action)
|
| + InspectorTest.completeTest();
|
| + else
|
| + InspectorTest.sendCommand("Debugger." + action);
|
| + }
|
| +
|
| + function failIfError(response)
|
| + {
|
| + if (response.error) {
|
| + InspectorTest.log(JSON.stringify(response));
|
| + InspectorTest.completeTest();
|
| + }
|
| + }
|
| +}
|
| +</script>
|
| +</head>
|
| +<body onload="runTest()">
|
| +</body>
|
| +</html>
|
|
|