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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile.html

Issue 1748993002: DevTools: Initial implementation of line-level CPU profile. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments. Created 4 years, 9 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script src="resources/timeline-data.js"></script>
6 <script>
7 function test()
8 {
9 var cpuProfile = {
10 startTime: 10,
11 endTime: 20,
12 head: {
13 functionName: "(root)",
14 hitCount: 0,
15 children: [
16 {
17 functionName: "foo1",
18 hitCount: 100,
19 positionTicks: [{line:1, ticks:10}, {line:2, ticks:20}, {lin e:3, ticks:30}, {line:4, ticks:40}],
20 children: []
21 },
22 {
23 functionName: "foo2",
24 hitCount: 200,
25 positionTicks: [{line:100, ticks:1}, {line:102, ticks:190}],
26 children: []
27 },
28 {
29 functionName: "null",
30 hitCount: 0,
31 positionTicks: [],
32 children: [
33 {
34 functionName: "bar",
35 hitCount: 300,
36 positionTicks: [{line:55, ticks:22}],
37 children: []
38 },
39 {
40 functionName: "baz",
41 hitCount: 400,
42 // no positionTicks for the node.
43 children: []
44 }
45 ]
46 }
47 ]
48 }
49 };
50
51 InspectorTest.addSniffer(WebInspector.CodeMirrorTextEditor.prototype, "setGu tterDecoration", decorationAdded, true);
52 InspectorTest.showScriptSource("timeline-data.js", frameRevealed);
53
54 function decorationAdded(line, type, element)
55 {
56 InspectorTest.addResult(`${line} ${type} ${element.textContent} ${elemen t.style.backgroundColor}`);
57 }
58
59 function setUrls(url, node)
60 {
61 node.url = url;
62 node.children.forEach(setUrls.bind(null, url));
63 }
64
65 function frameRevealed(frame)
66 {
67 var url = frame.uiSourceCode().url();
68 InspectorTest.addResult(InspectorTest.formatters.formatAsURL(url));
69 setUrls(url, cpuProfile.head);
70 var lineProfile = new WebInspector.TimelineModel.LineLevelProfile();
71 lineProfile.appendCPUProfile(new WebInspector.CPUProfileDataModel(cpuPro file));
72 WebInspector.panels.timeline._setLineLevelCPUProfile(lineProfile);
73 setTimeout(() => InspectorTest.completeTest(), 0);
74 }
75 }
76
77 </script>
78 </head>
79 <body onload="runTest()">
80 Tests that a line-level CPU profile is shown in the text editor.
81 </body>
82 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing/timeline-js-line-level-profile-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698