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

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

Issue 2375113002: tools: Log time to first contentful paint in customtabs_benchmark. (Closed)
Patch Set: Created 4 years, 3 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/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 0b7b2a2e25300c6dfd12e93c96d6a6d7d5ca1772..38600bef0d021e1b0d5aa8ffcd22aadd25637e7d 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
@@ -65,6 +65,7 @@ public class MainActivity extends Activity {
private long mIntentSentMs = 0;
private long mPageLoadStartedMs = 0;
private long mPageLoadFinishedMs = 0;
+ private long mFirstContentfulPaintMs = -1;
public CustomCallback(boolean warmup, int prerenderMode, int delayToMayLaunchUrl,
int delayToLaunchUrl) {
@@ -90,7 +91,7 @@ public class MainActivity extends Activity {
String logLine = (mWarmup ? "1" : "0") + "," + mPrerenderMode
+ "," + mDelayToMayLaunchUrl + "," + mDelayToLaunchUrl + ","
+ mIntentSentMs + "," + mPageLoadStartedMs + ","
- + mPageLoadFinishedMs;
+ + mPageLoadFinishedMs + "," + mFirstContentfulPaintMs;
Log.w(TAG, logLine);
}
break;
@@ -98,6 +99,14 @@ public class MainActivity extends Activity {
break;
}
}
+
+ @Override
+ public void extraCallback(String callbackName, Bundle args) {
+ assert "NavigationMetrics".equals(callbackName);
+ long value = args.getLong("firstContentfulPaint", -1);
+ // Can be reported several times, only record the first one.
+ if (mFirstContentfulPaintMs == -1) mFirstContentfulPaintMs = value;
+ }
}
private void onCustomTabsServiceConnected(CustomTabsClient client, final Uri uri,
« 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