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

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

Issue 2138713002: sandwich: Fix some trivial failures on SWR benchmark runs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses Egor's comments Created 4 years, 5 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 | tools/android/loading/sandwich_swr.py » ('j') | 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 454cbe0718a54aaede442e21ffe629f18116e3be..a0542dcc26aa43ff5bd323f00466640ca1df8bbe 100644
--- a/tools/android/loading/request_track.py
+++ b/tools/android/loading/request_track.py
@@ -341,7 +341,7 @@ class Request(object):
directives = [s.strip() for s in cache_control_str.split(',')]
for directive in directives:
parts = directive.split('=')
- if len(parts) == 1:
+ if len(parts) != 2:
continue
(name, value) = parts
if name == directive_name:
@@ -385,10 +385,12 @@ class Request(object):
net::HttpResponseHeaders's constructor.
"""
assert not self.IsDataRequest()
- headers = '{} {} {}\x00'.format(
- self.protocol.upper(), self.status, self.status_text)
+ assert self.HasReceivedResponse()
+ headers = bytes('{} {} {}\x00'.format(
+ self.protocol.upper(), self.status, self.status_text))
for key in sorted(self.response_headers.keys()):
- headers += '{}: {}\x00'.format(key, self.response_headers[key])
+ headers += (bytes(key.encode('latin-1')) + b': ' +
+ bytes(self.response_headers[key].encode('latin-1')) + b'\x00')
return headers
def __eq__(self, o):
« no previous file with comments | « no previous file | tools/android/loading/sandwich_swr.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698