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

Unified Diff: tools/android/loading/request_track.py

Issue 1708233002: tools/android/loading Ignore timings for requests coming from cache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fixIntegrationTests
Patch Set: Review comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/loading/request_track.py
diff --git a/tools/android/loading/request_track.py b/tools/android/loading/request_track.py
index 1b3cde2953e9065f22ec105724fc1e22146df0a9..685ab0d4973245a0da36a189dc8be11ea59348bf 100644
--- a/tools/android/loading/request_track.py
+++ b/tools/android/loading/request_track.py
@@ -491,12 +491,14 @@ class RequestTrack(devtools_monitor.Track):
# network stack.
('requestHeaders', 'request_headers'),
('headers', 'response_headers')))
- # data URLs don't have a timing dict.
timing_dict = {}
- if r.protocol != 'data':
- timing_dict = response['timing']
- else:
+ # data URLs don't have a timing dict, and timings for cached requests are
+ # stale.
+ # TODO(droger): the timestamp is inacurate, get the real timings instead.
+ if r.protocol == 'data' or r.served_from_cache:
timing_dict = {'requestTime': r.timestamp}
+ else:
+ timing_dict = response['timing']
r.timing = TimingFromDict(timing_dict)
self._requests_in_flight[request_id] = (r, RequestTrack._STATUS_RESPONSE)
self._request_id_to_response_received[request_id] = params
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698