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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java

Issue 2964183002: Fixes stuck navigation when opening PWA in-scope page in CCT. (Closed)
Patch Set: Merge Created 3 years, 5 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/customtabs/CustomTabActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java
index edf54da81c88d8f0d77124d8f03139a50865f194..e7e96e3981a3be8c16abb453cbc2043f0370ddd9 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappNavigationTest.java
@@ -39,7 +39,7 @@ import org.chromium.ui.base.PageTransition;
public class WebappNavigationTest {
private static final String OFF_ORIGIN_URL = "https://www.google.com/";
private static final String WEB_APP_PATH = "/chrome/test/data/banners/manifest_test_page.html";
- private static final String OTHER_PAGE_PATH =
+ private static final String IN_SCOPE_PAGE_PATH =
"/chrome/test/data/banners/manifest_no_service_worker.html";
@Rule
@@ -97,7 +97,7 @@ public class WebappNavigationTest {
@Test
@SmallTest
@Feature({"Webapps"})
- public void testNewTabLinkOpensInCct() throws Exception {
+ public void testOffScopeNewTabLinkOpensInCct() throws Exception {
runWebappActivityAndWaitForIdle(mActivityTestRule.createIntent().putExtra(
ShortcutHelper.EXTRA_THEME_COLOR, (long) Color.CYAN));
addAnchor("testId", OFF_ORIGIN_URL, "_blank");
@@ -111,6 +111,22 @@ public class WebappNavigationTest {
customTab.getToolbarManager().getPrimaryColor());
}
+ @Test
+ @SmallTest
+ @Feature({"Webapps"})
+ public void testInScopeNewTabLinkOpensInCct() throws Exception {
+ runWebappActivityAndWaitForIdle(mActivityTestRule.createIntent().putExtra(
+ ShortcutHelper.EXTRA_THEME_COLOR, (long) Color.CYAN));
+ addAnchor("testId", mTestServer.getURL(IN_SCOPE_PAGE_PATH), "_blank");
+ DOMUtils.clickNode(
+ mActivityTestRule.getActivity().getActivityTab().getContentViewCore(), "testId");
+ CustomTabActivity customTab = activityListener.waitFor(CustomTabActivity.class);
+ mActivityTestRule.waitUntilIdle(customTab);
+ Assert.assertTrue(
+ mActivityTestRule.runJavaScriptCodeInCurrentTab("document.body.textContent")
+ .contains("Do-nothing page with a service worker"));
+ }
+
@Test
@SmallTest
@Feature({"Webapps"})
@@ -141,10 +157,10 @@ public class WebappNavigationTest {
@Test
@SmallTest
@Feature({"Webapps"})
- public void testInOriginNavigationStaysInWebapp() throws Exception {
+ public void testInScopeNavigationStaysInWebapp() throws Exception {
runWebappActivityAndWaitForIdle(mActivityTestRule.createIntent());
- String otherPageUrl = mTestServer.getURL(OTHER_PAGE_PATH);
+ String otherPageUrl = mTestServer.getURL(IN_SCOPE_PAGE_PATH);
mActivityTestRule.loadUrlInTab(otherPageUrl, PageTransition.LINK,
mActivityTestRule.getActivity().getActivityTab());
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698