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

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

Issue 2758193002: [Android WebAPKs] Don't navigate WebAPK when launching it from launcher (Closed)
Patch Set: Merge branch 'master' into twitter 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/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 a237f8cdffe0801a83510a1c34f70f44fe8e674d..eb6b752ef21ebce38dca5135e56aa607844d9b70 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
@@ -73,13 +73,14 @@ public class WebApkInfoTest {
Intent intent = new Intent();
intent.putExtra(
ShortcutHelper.EXTRA_WEBAPK_PACKAGE_NAME, WebApkTestHelper.WEBAPK_PACKAGE_NAME);
- intent.putExtra(ShortcutHelper.EXTRA_URL, START_URL);
intent.putExtra(ShortcutHelper.EXTRA_SOURCE, ShortcutSource.NOTIFICATION);
WebApkInfo info = WebApkInfo.create(intent);
Assert.assertEquals(WebApkConstants.WEBAPK_ID_PREFIX + WebApkTestHelper.WEBAPK_PACKAGE_NAME,
info.id());
+ Assert.assertEquals(START_URL, info.uri().toString());
+ Assert.assertFalse(info.shouldLoadUrlIfAlreadyRunning());
Assert.assertEquals(SCOPE, info.scopeUri().toString());
Assert.assertEquals(NAME, info.name());
Assert.assertEquals(SHORT_NAME, info.shortName());
@@ -122,6 +123,7 @@ public class WebApkInfoTest {
WebApkInfo info = WebApkInfo.create(intent);
Assert.assertEquals(intentStartUrl, info.uri().toString());
+ Assert.assertTrue(info.shouldLoadUrlIfAlreadyRunning());
// {@link WebApkInfo#manifestStartUrl()} should contain the start URL from the Android
// Manifest.
@@ -175,7 +177,6 @@ public class WebApkInfoTest {
Intent intent = new Intent();
intent.putExtra(
ShortcutHelper.EXTRA_WEBAPK_PACKAGE_NAME, WebApkTestHelper.WEBAPK_PACKAGE_NAME);
- intent.putExtra(ShortcutHelper.EXTRA_URL, START_URL);
WebApkInfo info = WebApkInfo.create(intent);
Map<String, String> iconUrlToMurmur2HashMap = info.iconUrlToMurmur2HashMap();
@@ -200,7 +201,6 @@ public class WebApkInfoTest {
Intent intent = new Intent();
intent.putExtra(
ShortcutHelper.EXTRA_WEBAPK_PACKAGE_NAME, WebApkTestHelper.WEBAPK_PACKAGE_NAME);
- intent.putExtra(ShortcutHelper.EXTRA_URL, START_URL);
WebApkInfo info = WebApkInfo.create(intent);
Map<String, String> iconUrlToMurmur2HashMap = info.iconUrlToMurmur2HashMap();

Powered by Google App Engine
This is Rietveld 408576698