| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../../http/tests/inspector/inspector-test.js"></script> |
| 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../../http/tests/inspector/debugger-test.js"></script> |
| 5 <script src="../resources/timeline-data.js"></script> | 5 <script src="../resources/timeline-data.js"></script> |
| 6 <script> | 6 <script> |
| 7 function test() | 7 function test() |
| 8 { | 8 { |
| 9 var cpuProfile = { | 9 var cpuProfile = { |
| 10 startTime: 10e6, | 10 startTime: 10e6, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 { | 45 { |
| 46 id: 5, | 46 id: 5, |
| 47 callFrame: { functionName: "baz" }, | 47 callFrame: { functionName: "baz" }, |
| 48 hitCount: 400, | 48 hitCount: 400, |
| 49 // no positionTicks for the node. | 49 // no positionTicks for the node. |
| 50 children: [] | 50 children: [] |
| 51 } | 51 } |
| 52 ] | 52 ] |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 InspectorTest.addSniffer(WebInspector.CodeMirrorTextEditor.prototype, "setGu
tterDecoration", decorationAdded, true); | 55 InspectorTest.addSniffer(WebInspector.SourcesTextEditor.prototype, "setGutte
rDecoration", decorationAdded, true); |
| 56 InspectorTest.showScriptSource("timeline-data.js", frameRevealed); | 56 InspectorTest.showScriptSource("timeline-data.js", frameRevealed); |
| 57 | 57 |
| 58 function decorationAdded(line, type, element) | 58 function decorationAdded(line, type, element) |
| 59 { | 59 { |
| 60 InspectorTest.addResult(`${line} ${type} ${element.textContent} ${elemen
t.style.backgroundColor}`); | 60 InspectorTest.addResult(`${line} ${type} ${element.textContent} ${elemen
t.style.backgroundColor}`); |
| 61 } | 61 } |
| 62 | 62 |
| 63 function frameRevealed(frame) | 63 function frameRevealed(frame) |
| 64 { | 64 { |
| 65 var url = frame.uiSourceCode().url(); | 65 var url = frame.uiSourceCode().url(); |
| 66 InspectorTest.addResult(InspectorTest.formatters.formatAsURL(url)); | 66 InspectorTest.addResult(InspectorTest.formatters.formatAsURL(url)); |
| 67 cpuProfile.nodes.forEach(n => n.callFrame.url = url); | 67 cpuProfile.nodes.forEach(n => n.callFrame.url = url); |
| 68 var lineProfile = new WebInspector.LineLevelProfile.instance(); | 68 var lineProfile = new WebInspector.LineLevelProfile.instance(); |
| 69 lineProfile.appendCPUProfile(new WebInspector.CPUProfileDataModel(cpuPro
file)); | 69 lineProfile.appendCPUProfile(new WebInspector.CPUProfileDataModel(cpuPro
file)); |
| 70 setTimeout(() => InspectorTest.completeTest(), 0); | 70 setTimeout(() => InspectorTest.completeTest(), 0); |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 </script> | 74 </script> |
| 75 </head> | 75 </head> |
| 76 <body onload="runTest()"> | 76 <body onload="runTest()"> |
| 77 Tests that a line-level CPU profile is shown in the text editor. | 77 Tests that a line-level CPU profile is shown in the text editor. |
| 78 </body> | 78 </body> |
| 79 </html> | 79 </html> |
| OLD | NEW |