Commit 0dffe41c authored by lizeb's avatar lizeb Committed by Commit bot

customtabs: Enable first contentful paint reporting.

This removes the code to selectively enable reporting, and enables the
reporting. It was blocked by crbug.com/630303, which is now fixed.

BUG=630303

Review-Url: https://codereview.chromium.org/2364033002
Cr-Commit-Position: refs/heads/master@{#420624}
parent 7027cefe
...@@ -105,8 +105,6 @@ public class CustomTabsConnection { ...@@ -105,8 +105,6 @@ public class CustomTabsConnection {
private final AtomicBoolean mWarmupHasBeenCalled = new AtomicBoolean(); private final AtomicBoolean mWarmupHasBeenCalled = new AtomicBoolean();
private final AtomicBoolean mWarmupHasBeenFinished = new AtomicBoolean(); private final AtomicBoolean mWarmupHasBeenFinished = new AtomicBoolean();
private ExternalPrerenderHandler mExternalPrerenderHandler; private ExternalPrerenderHandler mExternalPrerenderHandler;
// TODO(lizeb): Remove once crbug.com/630303 is fixed.
private boolean mPageLoadMetricsEnabled;
/** /**
* <strong>DO NOT CALL</strong> * <strong>DO NOT CALL</strong>
...@@ -562,12 +560,6 @@ public class CustomTabsConnection { ...@@ -562,12 +560,6 @@ public class CustomTabsConnection {
return true; return true;
} }
// TODO(lizeb): Remove once crbug.com/630303 is fixed.
@VisibleForTesting
void enablePageLoadMetricsCallbacks() {
mPageLoadMetricsEnabled = true;
}
/** /**
* Notifies the application of a page load metric. * Notifies the application of a page load metric.
* *
...@@ -580,7 +572,6 @@ public class CustomTabsConnection { ...@@ -580,7 +572,6 @@ public class CustomTabsConnection {
*/ */
boolean notifyPageLoadMetric(CustomTabsSessionToken session, String metricName, long offsetMs) { boolean notifyPageLoadMetric(CustomTabsSessionToken session, String metricName, long offsetMs) {
CustomTabsCallback callback = mClientManager.getCallbackForSession(session); CustomTabsCallback callback = mClientManager.getCallbackForSession(session);
if (!mPageLoadMetricsEnabled) return false;
if (callback == null) return false; if (callback == null) return false;
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putLong(metricName, offsetMs); args.putLong(metricName, offsetMs);
......
...@@ -827,10 +827,6 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase { ...@@ -827,10 +827,6 @@ public class CustomTabActivityTest extends CustomTabActivityTestBase {
@SmallTest @SmallTest
@RetryOnFailure @RetryOnFailure
public void testPageLoadMetricIsSent() { public void testPageLoadMetricIsSent() {
Context context = getInstrumentation().getTargetContext().getApplicationContext();
CustomTabsConnection connection = CustomTabsConnection.getInstance((Application) context);
connection.enablePageLoadMetricsCallbacks();
final AtomicReference<Long> firstContentfulPaintMs = new AtomicReference<>(-1L); final AtomicReference<Long> firstContentfulPaintMs = new AtomicReference<>(-1L);
CustomTabsCallback cb = new CustomTabsCallback() { CustomTabsCallback cb = new CustomTabsCallback() {
@Override @Override
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment