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

Unified 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, 11 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/inspector/components/flame-chart.html
diff --git a/third_party/WebKit/LayoutTests/inspector/components/flame-chart.html b/third_party/WebKit/LayoutTests/inspector/components/flame-chart.html
new file mode 100644
index 0000000000000000000000000000000000000000..df5f86734c960e06ab74b8ec5fa64fec4e05075f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/components/flame-chart.html
@@ -0,0 +1,97 @@
+<html>
+<head>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script>
+function initialize_flameChartTest()
+{
+InspectorTest.preloadModule("perf_ui");
+
+InspectorTest.FlameChartProvider = class {
+ constructor(entries, groups, defaults) {
+ this._entries = entries;
+ this._defaults = defaults || {};
+
+ var entryLevels = entries.map(e => e.level);
+ var entryTotalTimes = entries.map(e => e.end - e.start);
+ var entryStartTimes = entries.map(e => e.start);
+ this._data = new PerfUI.FlameChart.TimelineData(entryLevels, entryTotalTimes, entryStartTimes, groups);
+ }
+
+ entryTitle(index) {
+ return this._entries[index].title || this._defaults.title || "";
+ }
+
+ entryColor(index) {
+ return this._entries[index].entryColor || this._defaults.entryColor || "green";
+ }
+
+ textColor(index) {
+ return this._entries[index].textColor || this._defaults.textColor || "blue";
+ }
+
+ entryFont(index) {
+ return this._entries[index].entryFont || this._defaults.entryFont || "12px";
+ }
+
+ timelineData() {
+ return this._data;
+ }
+
+ minimumBoundary() {
+ return this._data.entryStartTimes.reduce((a, b) => Math.min(a, b));
+ }
+
+ totalTime() {
+ return this._data.entryStartTimes.reduce((a, b) => Math.min(a, b)) - this.minimumBoundary();
+ }
+
+ maxStackDepth() {
+ return this._data.entryLevels.reduce((a, b) => Math.max(a, b));
+ }
+
+ prepareHighlightedEntryInfo(index) {
+ return null;
+ }
+
+ camJumpToEntry(index) {
+ return false;
+ }
+
+ forceDecoration(index) {
+ return false;
+ }
+
+ decorateEntry(entryIndex, context, text, barX, barY, barWidth, barHeight, unclippedBarX, timeToPixels) {
+ }
+}
+
+}
+
+
+function test()
+{
+ var entries = [
+ {start: 1000, end: 5000, level: 0, title: "AAAAAAAAAAAAAAAAAAAAAA"},
+ {start: 2000, end: 3000, level: 1, title: "bbbb"},
+ {start: 2000, end: 3000, level: 2, title: "cccc"},
+ {start: 4000, end: 5000, level: 1, title: "dddd"},
+ {start: 6000, end: 7000, level: 0, title: "eeee"},
+ ];
+
+ try {
+ var provider = new InspectorTest.FlameChartProvider(entries, null);
+ var flameChart = new PerfUI.FlameChart(provider, new PerfUI.FlameChartDelegate());
+ flameChart.update();
+ InspectorTest.addResult("PASSED")
+ } catch (e) {
+ InspectorTest.addResult("Failed: " + e.stack);
+ }
+ InspectorTest.completeTest();
+}
+
+</script>
+</head>
+<body onload="runTest()">
+<p>Smoke test for basic FlameChart functionality.</p>
+</body>
+</html>
« 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