Commit 99cdb31d authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

WebAppControllerBrowserTest starts https server

WebAppControllerBrowserTest::SetUpOnMainThread() now starts its
https server, avoiding the need to start the server in each
test case.

The http server and cert verifier in CustomTabBarViewBrowserTest
are retired, as this functionality is already provided by
WebAppControllerBrowserTest.

Change-Id: I67bcd661bca0ed647d3b2e9c8efa2217f19978cd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2089441
Commit-Queue: calamity <calamity@chromium.org>
Reviewed-by: default avatarcalamity <calamity@chromium.org>
Reviewed-by: default avatarCollin Baker <collinbaker@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarAlan Cutter <alancutter@chromium.org>
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#750848}
parent d1d40661
......@@ -2523,11 +2523,6 @@ class WebAppPictureInPictureWindowControllerBrowserTest
web_app::WebAppControllerBrowserTest::SetUpCommandLine(command_line);
}
void SetUpOnMainThread() override {
web_app::WebAppControllerBrowserTest::SetUpOnMainThread();
ASSERT_TRUE(https_server()->Start());
}
GURL main_url() {
return https_server()->GetURL(
"/extensions/auto_picture_in_picture/main.html");
......
......@@ -72,7 +72,6 @@ class BrowserNonClientFrameViewMacBrowserTest
IN_PROC_BROWSER_TEST_P(BrowserNonClientFrameViewMacBrowserTest, TitleUpdates) {
ui::test::ScopedFakeNSWindowFullscreen fake_fullscreen;
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetInstallableAppURL();
const web_app::AppId app_id = InstallPWA(app_url);
Browser* const browser = LaunchWebAppBrowser(app_id);
......
......@@ -169,26 +169,15 @@ class UrlHidingWebContentsObserver : public content::WebContentsObserver {
class CustomTabBarViewBrowserTest
: public web_app::WebAppControllerBrowserTest {
public:
CustomTabBarViewBrowserTest()
: https_server_(net::EmbeddedTestServer::TYPE_HTTPS) {}
~CustomTabBarViewBrowserTest() override {}
CustomTabBarViewBrowserTest() = default;
~CustomTabBarViewBrowserTest() override = default;
protected:
void SetUpInProcessBrowserTestFixture() override {
web_app::WebAppControllerBrowserTest::SetUpInProcessBrowserTestFixture();
cert_verifier_.SetUpInProcessBrowserTestFixture();
}
void TearDownInProcessBrowserTestFixture() override {
web_app::WebAppControllerBrowserTest::TearDownInProcessBrowserTestFixture();
cert_verifier_.TearDownInProcessBrowserTestFixture();
}
void SetUpCommandLine(base::CommandLine* command_line) override {
web_app::WebAppControllerBrowserTest::SetUpCommandLine(command_line);
// Browser will both run and display insecure content.
command_line->AppendSwitch(switches::kAllowRunningInsecureContent);
cert_verifier_.SetUpCommandLine(command_line);
}
void SetUp() override {
......@@ -198,12 +187,7 @@ class CustomTabBarViewBrowserTest
}
void SetUpOnMainThread() override {
https_server_.AddDefaultHandlers(GetChromeTestDataDir());
// Everything should be redirected to the http server.
host_resolver()->AddRule("*", "127.0.0.1");
// All SSL cert checks should be valid.
cert_verifier_.mock_cert_verifier()->set_default_result(net::OK);
web_app::WebAppControllerBrowserTest::SetUpOnMainThread();
browser_view_ = BrowserView::GetBrowserViewForBrowser(browser());
......@@ -233,8 +217,6 @@ class CustomTabBarViewBrowserTest
CustomTabBarView* custom_tab_bar_;
web_app::AppBrowserController* app_controller_;
net::EmbeddedTestServer* https_server() { return &https_server_; }
private:
void Install(std::unique_ptr<WebApplicationInfo> web_app_info) {
const GURL app_url = web_app_info->app_url;
......@@ -254,11 +236,6 @@ class CustomTabBarViewBrowserTest
base::test::ScopedFeatureList feature_list_;
net::EmbeddedTestServer https_server_;
// Similar to net::MockCertVerifier, but also updates the CertVerifier
// used by the NetworkService.
content::ContentMockCertVerifier cert_verifier_;
DISALLOW_COPY_AND_ASSIGN(CustomTabBarViewBrowserTest);
};
......@@ -288,8 +265,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest, IsNotCreatedInPopup) {
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
BackToAppButtonIsNotVisibleInOutOfScopePopups) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
const GURL& out_of_scope_url = GURL("https://example.com");
......@@ -313,7 +288,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
// Check the custom tab will be used for a Desktop PWA.
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest, IsUsedForDesktopPWA) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL& url = https_server()->GetURL("app.com", "/ssl/google.html");
......@@ -333,7 +307,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest, IsUsedForDesktopPWA) {
// Check the CustomTabBarView appears when a PWA window attempts to load
// insecure content.
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest, ShowsWithMixedContent) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL& url = https_server()->GetURL("app.com", "/ssl/google.html");
......@@ -362,8 +335,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest, ShowsWithMixedContent) {
// The custom tab bar should update with the title and location of the current
// page.
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest, TitleAndLocationUpdate) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
// This url is out of scope, because the CustomTabBar is not updated when it
......@@ -391,8 +362,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest, TitleAndLocationUpdate) {
// If the page doesn't specify a title, we should use the origin.
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
UsesLocationInsteadOfEmptyTitles) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
InstallPWA(app_url);
......@@ -413,8 +382,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
// Closing the CCT should take you back to the last in scope url.
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
OutOfScopeUrlShouldBeClosable) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
InstallPWA(app_url);
......@@ -452,8 +419,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
#endif
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
MAYBE_RightClickMenuShowsCopyUrl) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
InstallPWA(app_url);
......@@ -485,8 +450,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
// the CustomTabBar.
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
ScopeAboveLaunchURLShouldBeOutOfScopeAndClosable) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
InstallPWA(app_url);
......@@ -522,8 +485,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
IN_PROC_BROWSER_TEST_P(
CustomTabBarViewBrowserTest,
WhenNoHistoryIsInScopeCloseShouldNavigateToAppLaunchURL) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
InstallPWA(app_url);
......@@ -554,8 +515,6 @@ IN_PROC_BROWSER_TEST_P(
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
OriginsWithEmojiArePunyCoded) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
const GURL& navigate_to = GURL("https://🔒.example/ssl/blank_page.html");
......@@ -577,8 +536,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
OriginsWithNonASCIICharactersDisplayNormally) {
ASSERT_TRUE(https_server()->Start());
const GURL& app_url = https_server()->GetURL("app.com", "/ssl/google.html");
const GURL& navigate_to = GURL("https://ΐ.example/ssl/blank_page.html");
......@@ -601,7 +558,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
BackToAppButtonIsNotVisibleInScope) {
ASSERT_TRUE(embedded_test_server()->Start());
ASSERT_TRUE(https_server()->Start());
// We install over http because it's the easiest way to get a custom tab bar
// in scope. A PWA won't be installed over http in the real world (it'd make a
......@@ -653,7 +609,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
BackToAppButtonIsNotVisibleInBookmarkAppOnOrigin) {
ASSERT_TRUE(embedded_test_server()->Start());
ASSERT_TRUE(https_server()->Start());
const GURL& app_url =
embedded_test_server()->GetURL("app.com", "/ssl/google.html");
......@@ -686,7 +641,6 @@ IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest,
// Verify that interstitials that hide origin have their preference respected.
IN_PROC_BROWSER_TEST_P(CustomTabBarViewBrowserTest, InterstitialCanHideOrigin) {
ASSERT_TRUE(embedded_test_server()->Start());
ASSERT_TRUE(https_server()->Start());
InstallPWA(https_server()->GetURL("app.com", "/ssl/google.html"));
EXPECT_TRUE(app_browser_);
......
......@@ -45,13 +45,11 @@ class CreateShortcutBrowserTest : public WebAppControllerBrowserTest {
CHECK(provider);
return provider->registry_controller();
}
};
IN_PROC_BROWSER_TEST_P(CreateShortcutBrowserTest,
CreateShortcutForInstallableSite) {
base::UserActionTester user_action_tester;
ASSERT_TRUE(https_server()->Start());
NavigateToURLAndWait(browser(), GetInstallableAppURL());
AppId app_id = InstallShortcutAppForCurrentUrl();
......@@ -65,8 +63,6 @@ IN_PROC_BROWSER_TEST_P(CreateShortcutBrowserTest,
IN_PROC_BROWSER_TEST_P(CreateShortcutBrowserTest,
CanInstallOverTabShortcutApp) {
ASSERT_TRUE(https_server()->Start());
NavigateToURLAndWait(browser(), GetInstallableAppURL());
InstallShortcutAppForCurrentUrl();
......@@ -81,8 +77,6 @@ IN_PROC_BROWSER_TEST_P(CreateShortcutBrowserTest,
IN_PROC_BROWSER_TEST_P(CreateShortcutBrowserTest,
CannotInstallOverWindowShortcutApp) {
ASSERT_TRUE(https_server()->Start());
NavigateToURLAndWait(browser(), GetInstallableAppURL());
AppId app_id = InstallShortcutAppForCurrentUrl();
// Change launch container to open in window.
......
......@@ -98,8 +98,6 @@ class PWAMixedContentBrowserTestWithAutoupgradesDisabled
// a non-installable site.
IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTest,
ShortcutMenuOptionsForNonInstallableSite) {
ASSERT_TRUE(https_server()->Start());
EXPECT_FALSE(
NavigateAndAwaitInstallabilityCheck(browser(), GetMixedContentAppURL()));
......@@ -110,7 +108,6 @@ IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTest,
// Tests that mixed content is loaded inside PWA windows.
IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTestWithAutoupgradesDisabled,
MixedContentInPWA) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL app_url = GetMixedContentAppURL();
......@@ -124,7 +121,6 @@ IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTestWithAutoupgradesDisabled,
// tab.
IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTestWithAutoupgradesDisabled,
MixedContentOpenInChrome) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL app_url = GetMixedContentAppURL();
......@@ -162,7 +158,6 @@ IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTestWithAutoupgradesDisabled,
// content cannot be loaded in the new app window.
IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTestWithAutoupgradesDisabled,
MixedContentReparentWebContentsIntoAppBrowser) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL app_url = GetMixedContentAppURL();
......@@ -201,8 +196,6 @@ IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTestWithAutoupgradesDisabled,
// Tests that mixed content is not loaded inside iframes in PWA windows.
IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTest, IFrameMixedContentInPWA) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureIFrameAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -215,7 +208,6 @@ IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTest, IFrameMixedContentInPWA) {
IN_PROC_BROWSER_TEST_P(
PWAMixedContentBrowserTestWithAutoupgradesDisabled,
IFrameDynamicMixedContentInPWAReparentWebContentsIntoAppBrowser) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL app_url = GetSecureIFrameAppURL();
......@@ -241,7 +233,6 @@ IN_PROC_BROWSER_TEST_P(
// tab, when the iframe was created in a PWA window.
IN_PROC_BROWSER_TEST_P(PWAMixedContentBrowserTestWithAutoupgradesDisabled,
IFrameDynamicMixedContentInPWAOpenInChrome) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL app_url = GetSecureIFrameAppURL();
......
......@@ -32,7 +32,6 @@ class WebAppBadgingBrowserTest : public WebAppControllerBrowserTest {
WebAppControllerBrowserTest::SetUpOnMainThread();
ASSERT_TRUE(cross_origin_https_server_.Start());
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
GURL cross_site_frame_url =
......
......@@ -219,8 +219,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, HasMinimalUiButtons) {
// Tests that desktop PWAs open links in the browser.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, DesktopPWAsOpenLinksInApp) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -232,8 +230,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, DesktopPWAsOpenLinksInApp) {
// Tests that desktop PWAs open links in a new tab at the end of the tabstrip of
// the last active browser.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, DesktopPWAsOpenLinksInNewTab) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -267,8 +263,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, DesktopPWAsOpenLinksInNewTab) {
// Tests that desktop PWAs are opened at the correct size.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, PWASizeIsCorrectlyRestored) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -287,8 +281,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, PWASizeIsCorrectlyRestored) {
// Tests that desktop PWAs are reopened at the correct size.
IN_PROC_BROWSER_TEST_P(WebAppTabRestoreBrowserTest,
ReopenedPWASizeIsCorrectlyRestored) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -317,8 +309,6 @@ IN_PROC_BROWSER_TEST_P(WebAppTabRestoreBrowserTest,
// Tests that using window.open to create a popup window out of scope results in
// a correctly sized window.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, OffScopePWAPopupsHaveCorrectSize) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowser(app_id);
......@@ -350,8 +340,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, OffScopePWAPopupsHaveCorrectSize) {
// Tests that using window.open to create a popup window in scope results in
// a correctly sized window.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, InScopePWAPopupsHaveCorrectSize) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowser(app_id);
......@@ -379,8 +367,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, InScopePWAPopupsHaveCorrectSize) {
// Tests that app windows are correctly restored.
IN_PROC_BROWSER_TEST_P(WebAppTabRestoreBrowserTest, RestoreAppWindow) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -406,8 +392,6 @@ IN_PROC_BROWSER_TEST_P(WebAppTabRestoreBrowserTest, RestoreAppWindow) {
// to be shown to the user.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest,
LocationBarIsVisibleOffScopeOnSameOrigin) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -425,7 +409,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest,
}
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, UpgradeWithoutCustomTabBar) {
ASSERT_TRUE(https_server()->Start());
const GURL secure_app_url =
https_server()->GetURL("app.site.com", "/empty.html");
GURL::Replacements rep;
......@@ -450,8 +433,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, UpgradeWithoutCustomTabBar) {
}
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, OverscrollEnabled) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -482,8 +463,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, CopyURL) {
// Tests that the command for popping a tab out to a PWA window is disabled in
// incognito.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, PopOutDisabledInIncognito) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
......@@ -500,8 +479,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, PopOutDisabledInIncognito) {
// Tests that PWA menus have an uninstall option.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, UninstallMenuOption) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -523,8 +500,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, UninstallMenuOption) {
// Tests that both installing a PWA and creating a shortcut app are disabled for
// incognito windows.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, ShortcutMenuOptionsInIncognito) {
ASSERT_TRUE(https_server()->Start());
Browser* const incognito_browser = CreateIncognitoBrowser(profile());
EXPECT_FALSE(NavigateAndAwaitInstallabilityCheck(incognito_browser,
GetSecureAppURL()));
......@@ -538,8 +513,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, ShortcutMenuOptionsInIncognito) {
// Tests that both installing a PWA and creating a shortcut app are disabled for
// an error page.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, ShortcutMenuOptionsForErrorPage) {
ASSERT_TRUE(https_server()->Start());
EXPECT_FALSE(NavigateAndAwaitInstallabilityCheck(
browser(), https_server()->GetURL("/invalid_path.html")));
......@@ -551,8 +524,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, ShortcutMenuOptionsForErrorPage) {
// for an installable PWA.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest,
ShortcutMenuOptionsForInstallablePWA) {
ASSERT_TRUE(https_server()->Start());
EXPECT_TRUE(
NavigateAndAwaitInstallabilityCheck(browser(), GetInstallableAppURL()));
......@@ -562,8 +533,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest,
// Tests that an installed PWA is not used when out of scope by one path level.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, MenuOptionsOutsideInstalledPwaScope) {
ASSERT_TRUE(https_server()->Start());
NavigateToURLAndWait(
browser(),
https_server()->GetURL("/banners/scope_is_start_url/index.html"));
......@@ -581,7 +550,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, MenuOptionsOutsideInstalledPwaScope) {
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, InstallInstallableSite) {
base::UserActionTester user_action_tester;
ASSERT_TRUE(https_server()->Start());
NavigateToURLAndWait(browser(), GetInstallableAppURL());
const AppId app_id = InstallPwaForCurrentUrl();
......@@ -598,8 +566,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, InstallInstallableSite) {
}
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, CanInstallOverTabPwa) {
ASSERT_TRUE(https_server()->Start());
NavigateToURLAndWait(browser(), GetInstallableAppURL());
const AppId app_id = InstallPwaForCurrentUrl();
......@@ -618,8 +584,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, CanInstallOverTabPwa) {
}
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, CannotInstallOverWindowPwa) {
ASSERT_TRUE(https_server()->Start());
NavigateToURLAndWait(browser(), GetInstallableAppURL());
InstallPwaForCurrentUrl();
......@@ -634,8 +598,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, CannotInstallOverWindowPwa) {
}
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, CannotInstallOverPolicyPwa) {
ASSERT_TRUE(https_server()->Start());
ExternalInstallOptions options = CreateInstallOptions(GetInstallableAppURL());
options.install_source = ExternalInstallSource::kExternalPolicy;
PendingAppManagerInstall(profile(), options);
......@@ -654,8 +616,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, CannotInstallOverPolicyPwa) {
// Tests that the command for OpenActiveTabInPwaWindow is available for secure
// pages in an app's scope.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, ReparentWebAppForSecureActiveTab) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
......@@ -673,8 +633,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, ReparentWebAppForSecureActiveTab) {
// Tests that reparenting the last browser tab doesn't close the browser window.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, ReparentLastBrowserTab) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
NavigateToURLAndWait(browser(), app_url);
......@@ -689,8 +647,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, ReparentLastBrowserTab) {
// Tests that the manifest name of the current installable site is used in the
// installation menu text.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, InstallToShelfContainsAppName) {
ASSERT_TRUE(https_server()->Start());
EXPECT_TRUE(
NavigateAndAwaitInstallabilityCheck(browser(), GetInstallableAppURL()));
......@@ -707,8 +663,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, InstallToShelfContainsAppName) {
// Check that no assertions are hit when showing a permission request bubble.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, PermissionBubble) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowserAndWait(app_id);
......@@ -723,7 +677,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, PermissionBubble) {
// Ensure that web app windows with blank titles don't display the URL as a
// default window title.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, EmptyTitlesDoNotDisplayUrl) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = https_server()->GetURL("app.site.com", "/empty.html");
const AppId app_id = InstallPWA(app_url);
Browser* const app_browser = LaunchWebAppBrowser(app_id);
......@@ -740,7 +693,6 @@ IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, EmptyTitlesDoNotDisplayUrl) {
// Ensure that web app windows display the app title instead of the page
// title when off scope.
IN_PROC_BROWSER_TEST_P(WebAppBrowserTest, OffScopeUrlsDisplayAppTitle) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const base::string16 app_title = base::ASCIIToUTF16("A Web App");
......
......@@ -168,6 +168,7 @@ void WebAppControllerBrowserTest::SetUpCommandLine(
void WebAppControllerBrowserTest::SetUpOnMainThread() {
extensions::ExtensionBrowserTest::SetUpOnMainThread();
host_resolver()->AddRule("*", "127.0.0.1");
ASSERT_TRUE(https_server()->Start());
// By default, all SSL cert checks are valid. Can be overridden in tests.
cert_verifier_.mock_cert_verifier()->set_default_result(net::OK);
......
......@@ -190,8 +190,6 @@ class WebAppFileHandlingBrowserTest : public WebAppFileHandlingTestBase {
IN_PROC_BROWSER_TEST_P(WebAppFileHandlingBrowserTest,
LaunchConsumerIsNotTriggeredWithNoFiles) {
ASSERT_TRUE(https_server()->Start());
InstallFileHandlingPWA();
content::WebContents* web_contents =
LaunchWithFiles(app_id(), GetSecureAppURL(), {});
......@@ -200,8 +198,6 @@ IN_PROC_BROWSER_TEST_P(WebAppFileHandlingBrowserTest,
IN_PROC_BROWSER_TEST_P(WebAppFileHandlingBrowserTest,
PWAsCanReceiveFileLaunchParams) {
ASSERT_TRUE(https_server()->Start());
InstallFileHandlingPWA();
base::FilePath test_file_path = NewTestFilePath(FILE_PATH_LITERAL("txt"));
content::WebContents* web_contents = LaunchWithFiles(
......@@ -215,8 +211,6 @@ IN_PROC_BROWSER_TEST_P(WebAppFileHandlingBrowserTest,
IN_PROC_BROWSER_TEST_P(WebAppFileHandlingBrowserTest,
PWAsCanReceiveFileLaunchParamsInTab) {
ASSERT_TRUE(https_server()->Start());
InstallFileHandlingPWA();
base::FilePath test_file_path = NewTestFilePath(FILE_PATH_LITERAL("txt"));
content::WebContents* web_contents =
......@@ -231,8 +225,6 @@ IN_PROC_BROWSER_TEST_P(WebAppFileHandlingBrowserTest,
IN_PROC_BROWSER_TEST_P(WebAppFileHandlingBrowserTest,
PWAsDispatchOnCorrectFileHandlingURL) {
ASSERT_TRUE(https_server()->Start());
InstallFileHandlingPWA();
// Test that file handler dispatches correct URL based on file extension.
......@@ -266,7 +258,6 @@ class WebAppFileHandlingOriginTrialBrowserTest
void SetUpOnMainThread() override {
WebAppFileHandlingTestBase::SetUpOnMainThread();
ASSERT_TRUE(https_server()->Start());
}
void SetUpInterceptorNavigateToAppAndMaybeWait() {
......
......@@ -48,8 +48,6 @@ class WebAppUninstallBrowserTest : public WebAppControllerBrowserTest {
// Tests that app windows are restored in a tab if the app is uninstalled.
IN_PROC_BROWSER_TEST_P(WebAppUninstallBrowserTest,
RestoreAppWindowForUninstalledApp) {
ASSERT_TRUE(https_server()->Start());
const GURL app_url = GetSecureAppURL();
const AppId app_id = InstallPWA(app_url);
......@@ -80,7 +78,6 @@ IN_PROC_BROWSER_TEST_P(WebAppUninstallBrowserTest,
// Check that uninstalling a PWA with a window opened doesn't crash.
IN_PROC_BROWSER_TEST_P(WebAppUninstallBrowserTest,
UninstallPwaWithWindowOpened) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL app_url = GetSecureAppURL();
......@@ -97,7 +94,6 @@ IN_PROC_BROWSER_TEST_P(WebAppUninstallBrowserTest,
// PWAs moved to tabbed browsers should not get closed when uninstalled.
IN_PROC_BROWSER_TEST_P(WebAppUninstallBrowserTest,
UninstallPwaWithWindowMovedToTab) {
ASSERT_TRUE(https_server()->Start());
ASSERT_TRUE(embedded_test_server()->Start());
const GURL app_url = GetSecureAppURL();
......
......@@ -50,7 +50,6 @@ class ClearBrowsingDataHandlerBrowserTest
web_ui(), browser()->profile());
handler_->AllowJavascriptForTesting();
handler_->RegisterMessages();
ASSERT_TRUE(https_server()->Start());
}
void TearDownOnMainThread() override { handler_.reset(); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment