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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/components/flame-chart.html

Issue 2654253004: DevTools: fix flame chart on profiler pane (Closed)
Patch Set: Created 3 years, 10 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/components/flame-chart-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>
5 function initialize_flameChartTest()
6 {
7 InspectorTest.preloadModule("perf_ui");
8
9 InspectorTest.FlameChartProvider = class {
10 constructor(entries, groups, defaults) {
11 this._entries = entries;
12 this._defaults = defaults || {};
13
14 var entryLevels = entries.map(e => e.level);
15 var entryTotalTimes = entries.map(e => e.end - e.start);
16 var entryStartTimes = entries.map(e => e.start);
17 this._data = new PerfUI.FlameChart.TimelineData(entryLevels, entryTotalT imes, entryStartTimes, groups);
18 }
19
20 entryTitle(index) {
21 return this._entries[index].title || this._defaults.title || "";
22 }
23
24 entryColor(index) {
25 return this._entries[index].entryColor || this._defaults.entryColor || " green";
26 }
27
28 textColor(index) {
29 return this._entries[index].textColor || this._defaults.textColor || "bl ue";
30 }
31
32 entryFont(index) {
33 return this._entries[index].entryFont || this._defaults.entryFont || "12 px";
34 }
35
36 timelineData() {
37 return this._data;
38 }
39
40 minimumBoundary() {
41 return this._data.entryStartTimes.reduce((a, b) => Math.min(a, b));
42 }
43
44 totalTime() {
45 return this._data.entryStartTimes.reduce((a, b) => Math.min(a, b)) - thi s.minimumBoundary();
46 }
47
48 maxStackDepth() {
49 return this._data.entryLevels.reduce((a, b) => Math.max(a, b));
50 }
51
52 prepareHighlightedEntryInfo(index) {
53 return null;
54 }
55
56 camJumpToEntry(index) {
57 return false;
58 }
59
60 forceDecoration(index) {
61 return false;
62 }
63
64 decorateEntry(entryIndex, context, text, barX, barY, barWidth, barHeight, un clippedBarX, timeToPixels) {
65 }
66 }
67
68 }
69
70
71 function test()
72 {
73 var entries = [
74 {start: 1000, end: 5000, level: 0, title: "AAAAAAAAAAAAAAAAAAAAAA"},
75 {start: 2000, end: 3000, level: 1, title: "bbbb"},
76 {start: 2000, end: 3000, level: 2, title: "cccc"},
77 {start: 4000, end: 5000, level: 1, title: "dddd"},
78 {start: 6000, end: 7000, level: 0, title: "eeee"},
79 ];
80
81 try {
82 var provider = new InspectorTest.FlameChartProvider(entries, null);
83 var flameChart = new PerfUI.FlameChart(provider, new PerfUI.FlameChartDe legate());
84 flameChart.update();
85 InspectorTest.addResult("PASSED")
86 } catch (e) {
87 InspectorTest.addResult("Failed: " + e.stack);
88 }
89 InspectorTest.completeTest();
90 }
91
92 </script>
93 </head>
94 <body onload="runTest()">
95 <p>Smoke test for basic FlameChart functionality.</p>
96 </body>
97 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/components/flame-chart-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698