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

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

Issue 2018113002: Upstream: Do not show the add-to-homescreen/install-native-app infobar for WebAPKs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/javatests/src/org/chromium/chrome/browser/webapps/WebappVisibilityTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappVisibilityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappVisibilityTest.java
deleted file mode 100644
index b64925cc4adc8d9a0afd29ded9040f7802d2b391..0000000000000000000000000000000000000000
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappVisibilityTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chrome.browser.webapps;
-
-import android.content.Intent;
-import android.test.suitebuilder.annotation.MediumTest;
-
-import org.chromium.base.test.util.DisableIf;
-import org.chromium.base.test.util.Feature;
-import org.chromium.chrome.browser.ShortcutHelper;
-import org.chromium.components.security_state.ConnectionSecurityLevel;
-
-/**
- * Tests the logic in top controls visibility delegate in WebappActivity.
- */
-public class WebappVisibilityTest extends WebappActivityTestBase {
- private static final String WEBAPP_URL = "http://originalwebsite.com";
-
- @Override
- protected Intent createIntent() {
- Intent intent = super.createIntent();
- intent.putExtra(ShortcutHelper.EXTRA_URL, WEBAPP_URL);
- return intent;
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- startWebappActivity();
- }
-
- @MediumTest
- @Feature({"Webapps"})
- @DisableIf.Build(sdk_is_greater_than = 22, message = "crbug.com/614336")
- public void testShouldShowTopControls() {
- // Show top controls for out-of-domain URLs.
- assertTrue(getActivity().shouldShowTopControls(
- "http://notoriginalwebsite.com", ConnectionSecurityLevel.NONE));
- assertTrue(getActivity().shouldShowTopControls(
- "http://otherwebsite.com", ConnectionSecurityLevel.NONE));
-
- // Do not show top controls for subdomains and private registries that are secure.
- assertFalse(getActivity().shouldShowTopControls(
- "http://sub.originalwebsite.com", ConnectionSecurityLevel.NONE));
- assertFalse(getActivity().shouldShowTopControls(
- "http://thing.originalwebsite.com", ConnectionSecurityLevel.NONE));
- assertFalse(getActivity().shouldShowTopControls(WEBAPP_URL, ConnectionSecurityLevel.NONE));
- assertFalse(getActivity().shouldShowTopControls(
- WEBAPP_URL + "/things.html", ConnectionSecurityLevel.NONE));
- assertFalse(getActivity().shouldShowTopControls(
- WEBAPP_URL + "/stuff.html", ConnectionSecurityLevel.NONE));
-
- // Do not show top controls when URL is not available yet.
- assertFalse(getActivity().shouldShowTopControls("", ConnectionSecurityLevel.NONE));
-
- // Show top controls for non secure URLs.
- assertTrue(getActivity().shouldShowTopControls(
- "http://sub.originalwebsite.com", ConnectionSecurityLevel.SECURITY_WARNING));
- assertTrue(getActivity().shouldShowTopControls(
- "http://notoriginalwebsite.com", ConnectionSecurityLevel.SECURITY_ERROR));
- assertTrue(getActivity().shouldShowTopControls(
- "http://otherwebsite.com", ConnectionSecurityLevel.SECURITY_ERROR));
- assertTrue(getActivity().shouldShowTopControls(
- "http://thing.originalwebsite.com", ConnectionSecurityLevel.SECURITY_ERROR));
- assertTrue(getActivity().shouldShowTopControls(
- WEBAPP_URL, ConnectionSecurityLevel.SECURITY_WARNING));
- assertTrue(getActivity().shouldShowTopControls(
- WEBAPP_URL + "/things.html", ConnectionSecurityLevel.SECURITY_WARNING));
- assertTrue(getActivity().shouldShowTopControls(
- WEBAPP_URL + "/stuff.html", ConnectionSecurityLevel.SECURITY_WARNING));
- }
-}

Powered by Google App Engine
This is Rietveld 408576698