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

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

Issue 2473283003: DevTools: add per-frame grouping into aggregated timeline details (Closed)
Patch Set: rebased Created 4 years, 1 month 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-protocol/timeline/page-frames.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-protocol/tracing-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js
index 7524497e30c7fe21381c67b521cf1415fe031b6d..0c545b56164c1f4c2583754af0934c562e8b66d8 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector-protocol/tracing-test.js
@@ -110,13 +110,16 @@ InspectorTest.retrieveStream = function(streamHandle, offset, chunkSize, callbac
}
}
+InspectorTest.findEvents = function(name, ph, condition)
+{
+ return InspectorTest.devtoolsEvents.filter(e => e.name === name && e.ph === ph && (!condition || condition(e)));
+}
+
InspectorTest.findEvent = function(name, ph, condition)
{
- for (var i = 0; i < InspectorTest.devtoolsEvents.length; i++) {
- var e = InspectorTest.devtoolsEvents[i];
- if (e.name === name && e.ph === ph && (!condition || condition(e)))
- return e;
- }
+ var events = InspectorTest.findEvents(name, ph, condition);
+ if (events.length)
+ return events[0];
throw new Error("Couldn't find event " + name + " / " + ph + "\n\n in " + JSON.stringify(InspectorTest.devtoolsEvents, null, 2));
}
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector-protocol/timeline/page-frames.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698