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

Unified Diff: tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java

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
« no previous file with comments | « no previous file | tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java
diff --git a/tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java b/tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java
index 25ee24bbda3d4d3f13d26b65131ad2266887ba57..b1b336d46d39512fab62f319b3394cbe17613ac9 100644
--- a/tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java
+++ b/tools/android/customtabs_benchmark/java/src/org/chromium/customtabs/test/MainActivity.java
@@ -109,17 +109,11 @@ public class MainActivity extends Activity {
break;
case CustomTabsCallback.NAVIGATION_FINISHED:
mPageLoadFinishedMs = SystemClock.uptimeMillis();
- if (mIntentSentMs != NONE && mPageLoadStartedMs != NONE) {
- if (mFirstContentfulPaintMs != NONE) {
- logMetricsAndFinish();
- } else {
- logMetricsAndFinishDelayed(3000);
droger 2016/12/05 15:35:08 Are you sure this was not useful? The scenario I
Benoit L 2016/12/05 15:46:41 Yes, this doesn't happen very often, and the code
- }
- }
break;
default:
break;
}
+ if (allSet()) logMetricsAndFinish();
}
@Override
@@ -132,7 +126,12 @@ public class MainActivity extends Activity {
if (mFirstContentfulPaintMs == NONE) {
mFirstContentfulPaintMs = navigationStartMs + firstPaintMs;
}
- if (mPageLoadFinishedMs != NONE) logMetricsAndFinish();
+ if (allSet()) logMetricsAndFinish();
+ }
+
+ private boolean allSet() {
+ return mIntentSentMs != NONE && mPageLoadStartedMs != NONE
+ && mFirstContentfulPaintMs != NONE && mPageLoadFinishedMs != NONE;
}
/** Outputs the available metrics, and die. Unavalaible metrics are set to -1. */
@@ -153,7 +152,7 @@ public class MainActivity extends Activity {
public void run() {
logMetricsAndFinish();
}
- }, 3000);
+ }, delayMs);
}
}
« no previous file with comments | « no previous file | tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698