Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/debugger/stepping-with-source-map-and-blackboxing.html

Issue 1583383003: [DevTools] Send source map content from frontend to backend (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blackbox-inline-source-map
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspecto r-protocol-test.js"></script>
4 <script type="text/javascript" src="resources/framework-with-sourcemap.js"></scr ipt>
5 <script>
6 function boo()
7 {
8 return 239;
9 }
10
11 function testFunction()
12 {
13 debugger;
14 foo(boo);
15 }
16
17 function test()
18 {
19 var actions = [ "stepInto", "stepInto", "stepOut" ];
20
21 var sourceMap = {
22 version: 3,
23 sources: [ "foo.js" ],
24 names: [],
25 mappings: ";;AAAA,SAAS,GAAG,CAAC,GAAG,EAChB;AACI,QAAI,CAAC,GAAG,EAAE,CAA C;AACX,QAAI,GAAG,GAAG,GAAG,EAAE,CAAC;AAChB,WAAO,CAAE,GAAG,CAAC;CAChB"
26 };
27
28 InspectorTest.eventHandler["Debugger.paused"] = printStackTraceAndMakeNextSt ep;
29 InspectorTest.eventHandler["Debugger.scriptParsed"] = scriptParsed;
30 InspectorTest.sendCommand("Debugger.enable");
31
32 function scriptParsed(response)
33 {
34 failIfError(response);
35
36 if (response.params.url.endsWith("/framework-with-sourcemap.js"))
37 setSourceMapContent(response.params.scriptId);
38 }
39
40 function setSourceMapContent(scriptId)
41 {
42 InspectorTest.sendCommand("Debugger.setSourceMapContent", {
43 scriptId: scriptId,
44 content: JSON.stringify(sourceMap)
45 }, setSkipStackFrames);
46 }
47
48 function setSkipStackFrames(response)
49 {
50 failIfError(response);
51 InspectorTest.sendCommand("Debugger.skipStackFrames", { script: "foo\\.j s$"}, callTestFunction);
52 }
53
54 function callTestFunction(response)
55 {
56 failIfError(response);
57 InspectorTest.sendCommand("Runtime.evaluate", { "expression": "setTimeou t(testFunction, 0)"});
58 }
59
60 function printStackTraceAndMakeNextStep(response)
61 {
62 failIfError(response);
63 var callFrames = response.params.callFrames;
64 InspectorTest.log("Stack trace:")
65 for (var callFrame of callFrames)
66 InspectorTest.log(callFrame.functionName + ":" + callFrame.functionL ocation.lineNumber + ":" + callFrame.functionLocation.columnNumber);
67
68 var action = actions.shift();
69 if (!action)
70 InspectorTest.completeTest();
71 else
72 InspectorTest.sendCommand("Debugger." + action);
73 }
74
75 function failIfError(response)
76 {
77 if (response.error) {
78 InspectorTest.log(JSON.stringify(response));
79 InspectorTest.completeTest();
80 }
81 }
82 }
83 </script>
84 </head>
85 <body onload="runTest()">
86 </body>
87 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698