Index: third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html |
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html |
index 4c9c1c1c9f384df5c222e72e3304e5c8a51b464f..852edd4a17f8af23bdf2640f416b4c326f10665c 100644 |
--- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html |
+++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile.html |
@@ -9,43 +9,49 @@ function test() |
var cpuProfile = { |
startTime: 10, |
endTime: 20, |
- head: { |
- callFrame: { functionName: "(root)" }, |
- hitCount: 0, |
- children: [ |
- { |
- callFrame: { functionName: "foo1" }, |
- hitCount: 100, |
- positionTicks: [{line:1, ticks:10}, {line:2, ticks:20}, {line:3, ticks:30}, {line:4, ticks:40}], |
- children: [] |
- }, |
- { |
- callFrame: { functionName: "foo2" }, |
- hitCount: 200, |
- positionTicks: [{line:100, ticks:1}, {line:102, ticks:190}], |
- children: [] |
- }, |
- { |
- callFrame: { functionName: "null" }, |
- hitCount: 0, |
- positionTicks: [], |
- children: [ |
- { |
- callFrame: { functionName: "bar" }, |
- hitCount: 300, |
- positionTicks: [{line:55, ticks:22}], |
- children: [] |
- }, |
- { |
- callFrame: { functionName: "baz" }, |
- hitCount: 400, |
- // no positionTicks for the node. |
- children: [] |
- } |
- ] |
- } |
- ] |
- } |
+ nodes: [ |
+ { |
+ id: 0, |
+ callFrame: { functionName: "(root)" }, |
+ hitCount: 0, |
+ children: [1, 2] |
+ }, |
+ { |
+ id: 1, |
+ callFrame: { functionName: "foo1" }, |
+ hitCount: 100, |
+ positionTicks: [{line:1, ticks:10}, {line:2, ticks:20}, {line:3, ticks:30}, {line:4, ticks:40}], |
+ children: [] |
+ }, |
+ { |
+ id: 2, |
+ callFrame: { functionName: "foo2" }, |
+ hitCount: 200, |
+ positionTicks: [{line:100, ticks:1}, {line:102, ticks:190}], |
+ children: [3] |
+ }, |
+ { |
+ id: 3, |
+ callFrame: { functionName: "null" }, |
+ hitCount: 0, |
+ positionTicks: [], |
+ children: [4, 5] |
+ }, |
+ { |
+ id: 4, |
+ callFrame: { functionName: "bar" }, |
+ hitCount: 300, |
+ positionTicks: [{line:55, ticks:22}], |
+ children: [] |
+ }, |
+ { |
+ id: 5, |
+ callFrame: { functionName: "baz" }, |
+ hitCount: 400, |
+ // no positionTicks for the node. |
+ children: [] |
+ } |
+ ] |
}; |
InspectorTest.addSniffer(WebInspector.CodeMirrorTextEditor.prototype, "setGutterDecoration", decorationAdded, true); |
@@ -56,17 +62,11 @@ function test() |
InspectorTest.addResult(`${line} ${type} ${element.textContent} ${element.style.backgroundColor}`); |
} |
- function setUrls(url, node) |
- { |
- node.callFrame.url = url; |
- node.children.forEach(setUrls.bind(null, url)); |
- } |
- |
function frameRevealed(frame) |
{ |
var url = frame.uiSourceCode().url(); |
InspectorTest.addResult(InspectorTest.formatters.formatAsURL(url)); |
- setUrls(url, cpuProfile.head); |
+ cpuProfile.nodes.forEach(n => n.callFrame.url = url); |
var lineProfile = new WebInspector.LineLevelProfile.instance(); |
lineProfile.appendCPUProfile(new WebInspector.CPUProfileDataModel(cpuProfile)); |
setTimeout(() => InspectorTest.completeTest(), 0); |