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