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

Unified Diff: tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py

Issue 2551913002: tools: Fixes in customtabs_benchmark. (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
Index: tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
diff --git a/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py b/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
index 219a1751ae27e20d225b13f43cbf7870247227de..d4222b217ec09a5bf6809805f2761d0e6606bdcd 100755
--- a/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
+++ b/tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py
@@ -37,6 +37,8 @@ import device_setup
_CHROME_PACKAGE = 'com.google.android.apps.chrome'
_COMMAND_LINE_PATH = '/data/local/tmp/chrome-command-line'
_TEST_APP_PACKAGE_NAME = 'org.chromium.customtabsclient.test'
+_INVALID_VALUE = -1
+
# Command line arguments for Chrome.
CHROME_ARGS = [
@@ -151,8 +153,9 @@ def ParseResult(result_line):
assert len(tokens) == 8
intent_sent_timestamp = int(tokens[4])
return Result(bool(tokens[0]), tokens[1], int(tokens[2]), int(tokens[3]),
- int(tokens[5]) - intent_sent_timestamp,
- int(tokens[6]) - intent_sent_timestamp, int(tokens[7]))
+ max(_INVALID_VALUE, int(tokens[5]) - intent_sent_timestamp),
+ max(_INVALID_VALUE, int(tokens[6]) - intent_sent_timestamp),
+ max(_INVALID_VALUE, int(tokens[7]) - intent_sent_timestamp))
def LoopOnDevice(device, configs, output_filename, wpr_archive_path=None,
@@ -221,9 +224,9 @@ def ProcessOutput(filename):
result['speculation_mode'] = data[:, 1]
result['delay_to_may_launch_url'] = data[:, 2]
result['delay_to_launch_url'] = data[:, 3]
- result['commit'] = data[:, 5] - data[:, 4]
- result['plt'] = data[:, 6] - data[:, 4]
- result['first_contentful_paint'] = data[7]
+ result['commit'] = data[:, 4]
+ result['plt'] = data[:, 5]
+ result['first_contentful_paint'] = data[:, 6]
return result

Powered by Google App Engine
This is Rietveld 408576698