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

Unified Diff: chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/RecentsPlaceholderActivityTest.java

Issue 2762873003: Fix: long-tapping a WebAPK in recents shows Chrome.
Patch Set: yfriedman@'s comments. Created 3 years, 9 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
Index: chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/RecentsPlaceholderActivityTest.java
diff --git a/chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/MainActivityTest.java b/chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/RecentsPlaceholderActivityTest.java
similarity index 92%
rename from chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/MainActivityTest.java
rename to chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/RecentsPlaceholderActivityTest.java
index db4601d11e1a0a2352b62cb813819fae8f340260..7695a794d471958af9196b40f5bab9b3c65d83a9 100644
--- a/chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/MainActivityTest.java
+++ b/chrome/android/webapk/shell_apk/junit/src/org/chromium/webapk/shell_apk/RecentsPlaceholderActivityTest.java
@@ -29,7 +29,7 @@ import org.chromium.webapk.test.WebApkTestHelper;
*/
@RunWith(LocalRobolectricTestRunner.class)
@Config(manifest = Config.NONE, packageName = WebApkTestHelper.WEBAPK_PACKAGE_NAME)
-public class MainActivityTest {
+public class RecentsPlaceholderActivityTest {
private static final String HOST_BROWSER_PACKAGE_NAME = "truly.random";
private ShadowApplication mShadowApplication;
@@ -59,12 +59,12 @@ public class MainActivityTest {
// Make intents to Google Play not throw ActivityNotFoundException.
mPackageManager.addResolveInfoForIntent(
- MainActivity.createInstallIntent(HOST_BROWSER_PACKAGE_NAME),
+ LaunchWebApkHelper.createInstallIntent(HOST_BROWSER_PACKAGE_NAME),
newResolveInfo("google.play"));
- Robolectric.buildActivity(MainActivity.class).create();
-
+ Robolectric.buildActivity(RecentsPlaceholderActivity.class).create();
Intent startActivityIntent = mShadowApplication.getNextStartedActivity();
+
Assert.assertNotNull(startActivityIntent);
Assert.assertTrue(startActivityIntent.getDataString().startsWith("market://"));
}
@@ -84,9 +84,9 @@ public class MainActivityTest {
metaData.putString(WebApkMetaDataKeys.START_URL, "http://random.org");
WebApkTestHelper.registerWebApkWithMetaData(metaData);
- Robolectric.buildActivity(MainActivity.class).create();
-
+ Robolectric.buildActivity(RecentsPlaceholderActivity.class).create();
Intent startActivityIntent = mShadowApplication.getNextStartedActivity();
+
Assert.assertNull(startActivityIntent);
}

Powered by Google App Engine
This is Rietveld 408576698