Commit 5544f974 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

Desktop PWAs: ShelfWebAppBrowserTest cleanup

DesktopPWAsWithoutExtensions has shipped. Tests like
ShelfAppBrowserTest no longer need to be
parameterized.

Bug: 1065748
Change-Id: I42616fdd0d22d8f9b96bac88bd71269045737fd5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2454777
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814992}
parent d86ff62a
...@@ -85,7 +85,6 @@ ...@@ -85,7 +85,6 @@
#include "chrome/browser/web_applications/components/web_app_provider_base.h" #include "chrome/browser/web_applications/components/web_app_provider_base.h"
#include "chrome/browser/web_applications/system_web_app_manager.h" #include "chrome/browser/web_applications/system_web_app_manager.h"
#include "chrome/browser/web_applications/test/web_app_install_observer.h" #include "chrome/browser/web_applications/test/web_app_install_observer.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
...@@ -407,25 +406,14 @@ class ShelfAppBrowserTestNoDefaultBrowser : public ShelfAppBrowserTest { ...@@ -407,25 +406,14 @@ class ShelfAppBrowserTestNoDefaultBrowser : public ShelfAppBrowserTest {
} }
}; };
class ShelfWebAppBrowserTest class ShelfWebAppBrowserTest : public ShelfAppBrowserTest {
: public ShelfAppBrowserTest,
public ::testing::WithParamInterface<web_app::ProviderType> {
protected: protected:
ShelfWebAppBrowserTest() ShelfWebAppBrowserTest()
: https_server_(net::EmbeddedTestServer::TYPE_HTTPS) { : https_server_(net::EmbeddedTestServer::TYPE_HTTPS) {
if (GetParam() == web_app::ProviderType::kWebApps) {
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
} else if (GetParam() == web_app::ProviderType::kBookmarkApps) {
scoped_feature_list_.InitAndDisableFeature(
features::kDesktopPWAsWithoutExtensions);
}
} }
~ShelfWebAppBrowserTest() override = default; ~ShelfWebAppBrowserTest() override = default;
web_app::ProviderType provider_type() const { return GetParam(); }
net::EmbeddedTestServer* https_server() { return &https_server_; } net::EmbeddedTestServer* https_server() { return &https_server_; }
GURL GetSecureAppURL() { GURL GetSecureAppURL() {
...@@ -470,7 +458,6 @@ class ShelfWebAppBrowserTest ...@@ -470,7 +458,6 @@ class ShelfWebAppBrowserTest
} }
private: private:
base::test::ScopedFeatureList scoped_feature_list_;
net::EmbeddedTestServer https_server_; net::EmbeddedTestServer https_server_;
content::ContentMockCertVerifier cert_verifier_; content::ContentMockCertVerifier cert_verifier_;
}; };
...@@ -1190,7 +1177,7 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, AppIDForPinnedHostedApp) { ...@@ -1190,7 +1177,7 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, AppIDForPinnedHostedApp) {
// Verifies that native browser window properties are properly set when showing // Verifies that native browser window properties are properly set when showing
// an unpinned web app. // an unpinned web app.
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, AppIDForUnpinnedWebApp) { IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest, AppIDForUnpinnedWebApp) {
// Load and navigate to a web app. // Load and navigate to a web app.
const GURL app_url = GetSecureAppURL(); const GURL app_url = GetSecureAppURL();
const web_app::AppId web_app_id = InstallWebApp(app_url); const web_app::AppId web_app_id = InstallWebApp(app_url);
...@@ -1215,7 +1202,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, AppIDForUnpinnedWebApp) { ...@@ -1215,7 +1202,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, AppIDForUnpinnedWebApp) {
// Verifies that native browser window properties are properly set when showing // Verifies that native browser window properties are properly set when showing
// a pinned web app. // a pinned web app.
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, AppIDForPinnedWebApp) { IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest, AppIDForPinnedWebApp) {
// Load and navigate to a web app. // Load and navigate to a web app.
const GURL app_url = GetSecureAppURL(); const GURL app_url = GetSecureAppURL();
const web_app::AppId web_app_id = InstallWebApp(app_url); const web_app::AppId web_app_id = InstallWebApp(app_url);
...@@ -1239,7 +1226,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, AppIDForPinnedWebApp) { ...@@ -1239,7 +1226,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, AppIDForPinnedWebApp) {
// Verifies that native browser window properties are properly set when showing // Verifies that native browser window properties are properly set when showing
// a PWA tab. // a PWA tab.
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, AppIDForPWA) { IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest, AppIDForPWA) {
// Start server and open test page. // Start server and open test page.
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
ui_test_utils::NavigateToURL( ui_test_utils::NavigateToURL(
...@@ -2259,7 +2246,7 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DISABLED_V1AppNavigation) { ...@@ -2259,7 +2246,7 @@ IN_PROC_BROWSER_TEST_F(ShelfAppBrowserTest, DISABLED_V1AppNavigation) {
} }
// Ensure opening settings and task manager windows create new shelf items. // Ensure opening settings and task manager windows create new shelf items.
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, SettingsAndTaskManagerWindows) { IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest, SettingsAndTaskManagerWindows) {
// Install the Settings App. // Install the Settings App.
web_app::WebAppProvider::Get(browser()->profile()) web_app::WebAppProvider::Get(browser()->profile())
->system_web_app_manager() ->system_web_app_manager()
...@@ -2303,7 +2290,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, SettingsAndTaskManagerWindows) { ...@@ -2303,7 +2290,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, SettingsAndTaskManagerWindows) {
} }
// Check that tabbed hosted and web apps have correct shelf presence. // Check that tabbed hosted and web apps have correct shelf presence.
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, TabbedHostedAndWebApps) { IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest, TabbedHostedAndWebApps) {
// Load and pin a hosted app. // Load and pin a hosted app.
const Extension* hosted_app = const Extension* hosted_app =
LoadExtension(test_data_dir_.AppendASCII("app1/")); LoadExtension(test_data_dir_.AppendASCII("app1/"));
...@@ -2347,7 +2334,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, TabbedHostedAndWebApps) { ...@@ -2347,7 +2334,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, TabbedHostedAndWebApps) {
} }
// Check that windowed hosted and web apps have correct shelf presence. // Check that windowed hosted and web apps have correct shelf presence.
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, WindowedHostedAndWebApps) { IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest, WindowedHostedAndWebApps) {
// Load and pin a hosted app. // Load and pin a hosted app.
const Extension* hosted_app = const Extension* hosted_app =
LoadExtension(test_data_dir_.AppendASCII("app1/")); LoadExtension(test_data_dir_.AppendASCII("app1/"));
...@@ -2407,7 +2394,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, WindowedHostedAndWebApps) { ...@@ -2407,7 +2394,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, WindowedHostedAndWebApps) {
// Windowed progressive web apps should have shelf activity indicator showing // Windowed progressive web apps should have shelf activity indicator showing
// after install. // after install.
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest,
WindowedPwasHaveActivityIndicatorSet) { WindowedPwasHaveActivityIndicatorSet) {
// Start server and open test page. // Start server and open test page.
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
...@@ -2431,7 +2418,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, ...@@ -2431,7 +2418,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest,
// Windowed shortcut apps should have shelf activity indicator showing after // Windowed shortcut apps should have shelf activity indicator showing after
// install. // install.
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest,
WindowedShortcutAppsHaveActivityIndicatorSet) { WindowedShortcutAppsHaveActivityIndicatorSet) {
// Start server and open test page. // Start server and open test page.
ASSERT_TRUE(embedded_test_server()->Start()); ASSERT_TRUE(embedded_test_server()->Start());
...@@ -2453,7 +2440,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, ...@@ -2453,7 +2440,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest,
ChromeLauncherController::instance()->shelf_model()->active_shelf_id()); ChromeLauncherController::instance()->shelf_model()->active_shelf_id());
} }
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, WebAppPolicy) { IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest, WebAppPolicy) {
// Install web app. // Install web app.
GURL app_url = GURL("https://example.org/"); GURL app_url = GURL("https://example.org/");
web_app::AppId app_id = InstallWebApp(app_url); web_app::AppId app_id = InstallWebApp(app_url);
...@@ -2480,7 +2467,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, WebAppPolicy) { ...@@ -2480,7 +2467,7 @@ IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, WebAppPolicy) {
GetPinnableForAppID(app_id, profile())); GetPinnableForAppID(app_id, profile()));
} }
IN_PROC_BROWSER_TEST_P(ShelfWebAppBrowserTest, WebAppPolicyNonExistentApp) { IN_PROC_BROWSER_TEST_F(ShelfWebAppBrowserTest, WebAppPolicyNonExistentApp) {
// Don't install the web app. // Don't install the web app.
GURL app_url = GURL("https://example.org/"); GURL app_url = GURL("https://example.org/");
web_app::AppId app_id = web_app::GenerateAppIdFromURL(app_url); web_app::AppId app_id = web_app::GenerateAppIdFromURL(app_url);
...@@ -2857,10 +2844,4 @@ IN_PROC_BROWSER_TEST_P(PerDeskShelfAppBrowserTest, AppMenus) { ...@@ -2857,10 +2844,4 @@ IN_PROC_BROWSER_TEST_P(PerDeskShelfAppBrowserTest, AppMenus) {
} }
} }
INSTANTIATE_TEST_SUITE_P(All,
ShelfWebAppBrowserTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
INSTANTIATE_TEST_SUITE_P(All, PerDeskShelfAppBrowserTest, ::testing::Bool()); INSTANTIATE_TEST_SUITE_P(All, PerDeskShelfAppBrowserTest, ::testing::Bool());
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