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

Unified Diff: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java

Issue 2796773002: [Android WebAPKs] Force navigation on launch by default (Closed)
Patch Set: Merge branch 'master' into fix_deep_link Created 3 years, 8 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 | « chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java
index 7ff886c866ca080d49951fba3403abb4e9ffe87d..34a80cee3114edc5f9b195274549011fd1332531 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/webapps/WebApkInfoTest.java
@@ -210,4 +210,25 @@ public class WebApkInfoTest {
Assert.assertEquals(1, iconUrlToMurmur2HashMap.size());
Assert.assertTrue(iconUrlToMurmur2HashMap.containsValue(hash));
}
+
+ /**
+ * Prior to SHELL_APK_VERSION 2, WebAPKs did not specify
+ * {@link WebApkConstants.EXTRA_WEBAPK_FORCE_NAVIGATION} in the intent. Test that
+ * {@link WebApkInfo#shouldForceNavigation()} defaults to true when the intent extra is not
+ * specified.
+ */
+ @Test
+ public void testForceNavigationNotSpecified() {
+ Bundle bundle = new Bundle();
+ bundle.putString(WebApkMetaDataKeys.START_URL, START_URL);
+ WebApkTestHelper.registerWebApkWithMetaData(bundle);
+
+ Intent intent = new Intent();
+ intent.putExtra(
+ WebApkConstants.EXTRA_WEBAPK_PACKAGE_NAME, WebApkTestHelper.WEBAPK_PACKAGE_NAME);
+ intent.putExtra(ShortcutHelper.EXTRA_URL, START_URL);
+
+ WebApkInfo info = WebApkInfo.create(intent);
+ Assert.assertTrue(info.shouldForceNavigation());
+ }
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698