Commit f6e5e968 authored by Eric Willigers's avatar Eric Willigers Committed by Commit Bot

SystemWebAppManagerBrowserTest tests bookmark and web apps

The test suite SystemWebAppManagerBrowserTest is now parameterized,
and runs with both bookmark and web app backend implementations.

Not yet updated:
SystemWebAppManagerAdditionalSearchTermsTest.AdditionalSearchTerms
and SystemWebAppManagerNotShownInLauncherTest.NotShownInLauncher
currently fails with web apps. Tracked in crbug.com/1054195

In system_web_app_manager_browsertest.cc, helper methods
EvalJs and ExecJs are retired as they have no clients.

TBR=pkasting@chromium.org

Bug: 1054195
Change-Id: Ib76ed1e2b14f42bf81138c61f5c263652dbe1ad2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2086355
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746683}
parent e725b698
......@@ -17,7 +17,7 @@
#include "ui/aura/window.h"
SystemWebAppIntegrationTest::SystemWebAppIntegrationTest()
: SystemWebAppManagerBrowserTest(false /* install_mock */) {}
: SystemWebAppManagerBrowserTestBase(false /* install_mock */) {}
SystemWebAppIntegrationTest::~SystemWebAppIntegrationTest() = default;
......
......@@ -18,8 +18,9 @@ class Profile;
// Test harness for how ChromeOS System Web Apps integrate with the System Web
// App platform.
// TODO(crbug.com/1058274): Inherit from SystemWebAppManagerBrowserTest.
class SystemWebAppIntegrationTest
: public web_app::SystemWebAppManagerBrowserTest {
: public web_app::SystemWebAppManagerBrowserTestBase {
public:
SystemWebAppIntegrationTest();
~SystemWebAppIntegrationTest() override;
......
......@@ -158,7 +158,7 @@ using SystemWebAppNonClientFrameViewBrowserTest =
web_app::SystemWebAppManagerBrowserTest;
// System Web Apps don't get the hosted app buttons.
IN_PROC_BROWSER_TEST_F(SystemWebAppNonClientFrameViewBrowserTest,
IN_PROC_BROWSER_TEST_P(SystemWebAppNonClientFrameViewBrowserTest,
HideHostedAppButtonContainer) {
Browser* app_browser =
WaitForSystemAppInstallAndLaunch(web_app::SystemAppType::SETTINGS);
......@@ -267,3 +267,9 @@ IN_PROC_BROWSER_TEST_F(BrowserNonClientFrameViewBrowserTest, SaveCardIcon) {
EXPECT_TRUE(app_frame_view_->Contains(icon));
EXPECT_TRUE(icon->GetVisible());
}
INSTANTIATE_TEST_SUITE_P(All,
SystemWebAppNonClientFrameViewBrowserTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
......@@ -11,6 +11,7 @@
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/web_applications/test/test_system_web_app_installation.h"
#include "chrome/browser/web_applications/test/test_web_app_provider.h"
#include "chrome/browser/web_applications/test/web_app_test.h"
#include "chrome/test/base/in_process_browser_test.h"
class Browser;
......@@ -28,15 +29,17 @@ namespace web_app {
enum class SystemAppType;
class SystemWebAppManagerBrowserTest : public InProcessBrowserTest {
// Clients should use SystemWebAppManagerBrowserTest, so test can be run with
// both the new web apps provider and the legacy bookmark apps provider.
class SystemWebAppManagerBrowserTestBase : public InProcessBrowserTest {
public:
// Performs common initialization for testing SystemWebAppManager features.
// If true, |install_mock| installs a WebUIController that serves a mock
// System PWA, and ensures the WebAppProvider associated with the startup
// profile is a TestWebAppProviderCreator.
explicit SystemWebAppManagerBrowserTest(bool install_mock = true);
explicit SystemWebAppManagerBrowserTestBase(bool install_mock = true);
~SystemWebAppManagerBrowserTest() override;
~SystemWebAppManagerBrowserTestBase() override;
// Returns the SystemWebAppManager for browser()->profile(). This will be a
// TestSystemWebAppManager if initialized with |install_mock| true.
......@@ -66,7 +69,20 @@ class SystemWebAppManagerBrowserTest : public InProcessBrowserTest {
base::test::ScopedFeatureList scoped_feature_list_;
DISALLOW_COPY_AND_ASSIGN(SystemWebAppManagerBrowserTest);
DISALLOW_COPY_AND_ASSIGN(SystemWebAppManagerBrowserTestBase);
};
class SystemWebAppManagerBrowserTest
: public SystemWebAppManagerBrowserTestBase,
public ::testing::WithParamInterface<web_app::ProviderType> {
public:
explicit SystemWebAppManagerBrowserTest(bool install_mock = true);
~SystemWebAppManagerBrowserTest() override = default;
web_app::ProviderType provider_type() const { return GetParam(); }
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
} // namespace web_app
......
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