| Index: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkIntegrationTest.java
|
| diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkIntegrationTest.java
|
| index 99595a36db593a80a501b25b066dd1c6f9f698da..17d4ccdcd9480c5eaedeacddd4ef108a67d77490 100644
|
| --- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkIntegrationTest.java
|
| +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebApkIntegrationTest.java
|
| @@ -4,6 +4,7 @@
|
|
|
| package org.chromium.chrome.browser.webapps;
|
|
|
| +import android.app.Activity;
|
| import android.content.Intent;
|
| import android.support.test.InstrumentationRegistry;
|
| import android.support.test.filters.LargeTest;
|
| @@ -15,11 +16,11 @@ import org.junit.Rule;
|
| import org.junit.Test;
|
| import org.junit.runner.RunWith;
|
|
|
| +import org.chromium.base.ApplicationStatus;
|
| import org.chromium.base.metrics.RecordHistogram;
|
| import org.chromium.base.test.util.CommandLineFlags;
|
| import org.chromium.base.test.util.Feature;
|
| import org.chromium.base.test.util.ScalableTimeout;
|
| -import org.chromium.chrome.browser.ChromeActivity;
|
| import org.chromium.chrome.browser.ChromeSwitches;
|
| import org.chromium.chrome.browser.DeferredStartupHandler;
|
| import org.chromium.chrome.browser.ShortcutHelper;
|
| @@ -45,9 +46,6 @@ public class WebApkIntegrationTest {
|
| @Rule
|
| public final NativeLibraryTestRule mNativeLibraryTestRule = new NativeLibraryTestRule();
|
|
|
| - @Rule
|
| - public final TopActivityListener activityListener = new TopActivityListener();
|
| -
|
| private static final long STARTUP_TIMEOUT = ScalableTimeout.scaleTimeout(10000);
|
|
|
| private EmbeddedTestServer mTestServer;
|
| @@ -126,11 +124,14 @@ public class WebApkIntegrationTest {
|
| CriteriaHelper.pollUiThread(new Criteria() {
|
| @Override
|
| public boolean isSatisfied() {
|
| - ChromeActivity activity = (ChromeActivity) activityListener.getMostRecentActivity();
|
| - return activity instanceof CustomTabActivity
|
| - && activity.getActivityTab() != null
|
| + Activity activity = ApplicationStatus.getLastTrackedFocusedActivity();
|
| + if (!(activity instanceof CustomTabActivity)) {
|
| + return false;
|
| + }
|
| + CustomTabActivity customTab = (CustomTabActivity) activity;
|
| + return customTab.getActivityTab() != null
|
| // Dropping the TLD as Google can redirect to a local site.
|
| - && activity.getActivityTab().getUrl().startsWith("https://www.google.");
|
| + && customTab.getActivityTab().getUrl().startsWith("https://www.google.");
|
| }
|
| });
|
| }
|
|
|