| 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());
|
| + }
|
| }
|
|
|