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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/tracing/timeline-receive-response-event.html

Issue 2563613004: Deflake http/tests/inspector/tracing/timeline-receive-response-event.html (Closed)
Patch Set: 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/http/tests/inspector/tracing/timeline-receive-response-event-expected.txt » ('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/tracing/timeline-receive-response-event.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/tracing/timeline-receive-response-event.html b/third_party/WebKit/LayoutTests/http/tests/inspector/tracing/timeline-receive-response-event.html
index 06ef735b8a95098525f33bffb33e897a31ea5878..c20c40a9bb05c90045061eb6765ed79b361e6bcb 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/tracing/timeline-receive-response-event.html
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/tracing/timeline-receive-response-event.html
@@ -33,12 +33,21 @@ function test()
var recordTypes = TimelineModel.TimelineModel.RecordType;
var typesToDump = new Set([recordTypes.ResourceSendRequest, recordTypes.ResourceReceiveResponse, recordTypes.ResourceReceivedData, recordTypes.ResourceFinish,
recordTypes.EventDispatch, recordTypes.FunctionCall]);
+ let hasAlreadyDumptReceivedDataFor = new Map();
function dumpEvent(traceEvent, level)
{
// Ignore stray paint & rendering events for better stability.
var categoryName = Timeline.TimelineUIUtils.eventStyle(traceEvent).category.name;
if (categoryName !== "loading" && categoryName !== "scripting")
return;
+ if (traceEvent.name === 'ResourceReceivedData') {
+ const requestId = traceEvent.args['data']['requestId'];
+ // Dump only the first ResourceReceivedData for a request for stability.
+ if (hasAlreadyDumptReceivedDataFor[requestId])
+ return;
+ hasAlreadyDumptReceivedDataFor[requestId] = true;
+ }
+
// Here and below: pretend coalesced record are just not there, as coalescation is time dependent and, hence, not stable.
// Filter out InjectedScript function call because they happen out of sync.
if (typesToDump.has(traceEvent.name) && (traceEvent.name !== "FunctionCall" || traceEvent.args["data"]["url"]))
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/inspector/tracing/timeline-receive-response-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698