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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js

Issue 2563383003: DevTools: add extension API to contribute trace events to timeline (Closed)
Patch Set: lint + new compiler warnings Created 4 years 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/extensions/extensions-timeline-api.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
index 0adef3b6c83fb7184fecdd89cfe04503f2753bae..c1ad4c830c3f1662981b91bf341ab2282aa0f712 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/timeline-test.js
@@ -410,6 +410,40 @@ InspectorTest.dumpInvalidations = function(recordType, index, comment)
InspectorTest.addArray(TimelineModel.InvalidationTracker.invalidationEventsFor(record._event), InspectorTest.InvalidationFormatters, "", comment);
}
+InspectorTest.dumpFlameChartProvider = function(provider, includeGroups)
+{
+ var includeGroupsSet = includeGroups && new Set(includeGroups);
+ var timelineData = provider.timelineData();
+ var stackDepth = provider.maxStackDepth();
+ var entriesByLevel = new Multimap();
+
+ for (let i = 0; i < timelineData.entryLevels.length; ++i)
+ entriesByLevel.set(timelineData.entryLevels[i], i);
+
+ for (let groupIndex = 0; groupIndex < timelineData.groups.length; ++groupIndex) {
+ const group = timelineData.groups[groupIndex];
+ if (includeGroupsSet && !includeGroupsSet.has(group.name))
+ continue;
+ var maxLevel = groupIndex + 1 < timelineData.groups.length ? timelineData.groups[groupIndex + 1].firstLevel : stackDepth;
+ InspectorTest.addResult(`Group: ${group.name}`);
+ for (let level = group.startLevel; level < maxLevel; ++level) {
+ InspectorTest.addResult(`Level ${level - group.startLevel}`);
+ var entries = entriesByLevel.get(level);
+ for (const index of entries) {
+ const title = provider.entryTitle(index);
+ const color = provider.entryColor(index);
+ InspectorTest.addResult(`${title} (${color})`);
+ }
+ }
+ }
+}
+
+InspectorTest.dumpTimelineFlameChart = function(includeGroups) {
+ const provider = UI.panels.timeline._flameChart._dataProvider;
+ InspectorTest.addResult('Timeline Flame Chart');
+ InspectorTest.dumpFlameChartProvider(provider, includeGroups);
+}
+
InspectorTest.FakeFileReader.prototype = {
start: function(output)
{
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/extensions/extensions-timeline-api.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698