Commit 222a85fc authored by Dom Schulz's avatar Dom Schulz Committed by Commit Bot

Remove the bookmark/web app params from swa browser test

Bug: 1065748
Change-Id: If1bce411ee66994a912a398514abc8e909715387
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2461569
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Auto-Submit: Dominic Schulz <dominicschulz@google.com>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815984}
parent f96951d2
......@@ -80,8 +80,7 @@ apps::AppServiceProxy* GetAppServiceProxy(Profile* profile) {
namespace web_app {
SystemWebAppManagerBrowserTestBase::SystemWebAppManagerBrowserTestBase(
bool install_mock) {
}
bool install_mock) {}
SystemWebAppManagerBrowserTestBase::~SystemWebAppManagerBrowserTestBase() =
default;
......@@ -181,13 +180,6 @@ GURL SystemWebAppManagerBrowserTestBase::GetStartUrl(
SystemWebAppManagerBrowserTest::SystemWebAppManagerBrowserTest(
bool install_mock)
: SystemWebAppManagerBrowserTestBase(install_mock) {
if (provider_type() == ProviderType::kWebApps) {
scoped_feature_list_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
} else if (provider_type() == ProviderType::kBookmarkApps) {
scoped_feature_list_.InitAndDisableFeature(
features::kDesktopPWAsWithoutExtensions);
}
if (install_mock) {
maybe_installation_ =
TestSystemWebAppInstallation::SetUpStandaloneSingleWindowApp(
......@@ -254,18 +246,11 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerWebAppInfoBrowserTest, Install) {
std::string SystemWebAppManagerTestParamsToString(
const ::testing::TestParamInfo<SystemWebAppManagerTestParams>& param_info) {
std::string output;
switch (std::get<0>(param_info.param)) {
case ProviderType::kBookmarkApps:
output.append("BookmarkApps");
break;
case ProviderType::kWebApps:
output.append("WebApps");
break;
}
if (std::get<1>(param_info.param) == InstallationType::kWebAppInfoInstall) {
if (std::get<0>(param_info.param) == InstallationType::kWebAppInfoInstall) {
output.append("_WebAppInfoInstall");
}
switch (std::get<2>(param_info.param)) {
switch (std::get<1>(param_info.param)) {
case TestProfileType::kRegular:
break;
case TestProfileType::kIncognito:
......@@ -275,6 +260,10 @@ std::string SystemWebAppManagerTestParamsToString(
output.append("_Guest");
break;
}
// The framework doesn't accept a blank param
if (output.empty()) {
output = "_Default";
}
return output;
}
......@@ -390,22 +379,13 @@ class SystemWebAppManagerFileHandlingBrowserTestBase
explicit SystemWebAppManagerFileHandlingBrowserTestBase(
IncludeLaunchDirectory include_launch_directory)
: SystemWebAppManagerBrowserTestBase(/*install_mock=*/false) {
web_app::ProviderType provider_type = std::get<0>(GetParam());
if (provider_type == ProviderType::kWebApps) {
scoped_feature_web_app_provider_type_.InitAndEnableFeature(
features::kDesktopPWAsWithoutExtensions);
} else if (provider_type == ProviderType::kBookmarkApps) {
scoped_feature_web_app_provider_type_.InitAndDisableFeature(
features::kDesktopPWAsWithoutExtensions);
}
scoped_feature_blink_api_.InitWithFeatures(
{blink::features::kFileHandlingAPI}, {});
maybe_installation_ =
TestSystemWebAppInstallation::SetUpAppThatReceivesLaunchFiles(
include_launch_directory,
std::get<1>(GetParam()) == InstallationType::kWebAppInfoInstall);
std::get<0>(GetParam()) == InstallationType::kWebAppInfoInstall);
}
content::WebContents* LaunchApp(
......
......@@ -99,15 +99,12 @@ class SystemWebAppManagerBrowserTestBase : public InProcessBrowserTest {
content::WebContents* LaunchApp(const apps::AppLaunchParams& params,
bool wait_for_load,
Browser** out_browser);
base::test::ScopedFeatureList scoped_feature_list_;
};
enum class InstallationType { kManifestInstall, kWebAppInfoInstall };
using SystemWebAppManagerTestParams =
std::tuple<ProviderType, InstallationType, TestProfileType>;
std::tuple<InstallationType, TestProfileType>;
class SystemWebAppManagerBrowserTest
: public SystemWebAppManagerBrowserTestBase,
......@@ -116,17 +113,13 @@ class SystemWebAppManagerBrowserTest
explicit SystemWebAppManagerBrowserTest(bool install_mock = true);
~SystemWebAppManagerBrowserTest() override = default;
ProviderType provider_type() const { return std::get<0>(GetParam()); }
bool install_from_web_app_info() const {
return std::get<1>(GetParam()) == InstallationType::kWebAppInfoInstall;
return std::get<0>(GetParam()) == InstallationType::kWebAppInfoInstall;
}
TestProfileType profile_type() const { return std::get<2>(GetParam()); }
TestProfileType profile_type() const { return std::get<1>(GetParam()); }
// InProcessBrowserTest:
void SetUpCommandLine(base::CommandLine* command_line) override;
private:
base::test::ScopedFeatureList scoped_feature_list_;
};
using SystemWebAppManagerWebAppInfoBrowserTest = SystemWebAppManagerBrowserTest;
......@@ -145,8 +138,6 @@ std::string SystemWebAppManagerTestParamsToString(
INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \
SUITE, \
::testing::Combine( \
::testing::Values(web_app::ProviderType::kBookmarkApps, \
web_app::ProviderType::kWebApps), \
::testing::Values(web_app::InstallationType::kManifestInstall, \
web_app::InstallationType::kWebAppInfoInstall), \
::testing::Values(TestProfileType::kRegular)))
......@@ -156,8 +147,6 @@ std::string SystemWebAppManagerTestParamsToString(
INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \
SUITE, \
::testing::Combine( \
::testing::Values(web_app::ProviderType::kBookmarkApps, \
web_app::ProviderType::kWebApps), \
::testing::Values(web_app::InstallationType::kManifestInstall), \
::testing::Values(TestProfileType::kRegular)))
......@@ -166,8 +155,6 @@ std::string SystemWebAppManagerTestParamsToString(
INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \
SUITE, \
::testing::Combine( \
::testing::Values(web_app::ProviderType::kBookmarkApps, \
web_app::ProviderType::kWebApps), \
::testing::Values(web_app::InstallationType::kWebAppInfoInstall), \
::testing::Values(TestProfileType::kRegular)))
......@@ -181,8 +168,6 @@ std::string SystemWebAppManagerTestParamsToString(
SUITE, INSTALL_TYPE) \
INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \
SUITE, ::testing::Combine( \
::testing::Values(web_app::ProviderType::kBookmarkApps, \
web_app::ProviderType::kWebApps), \
::testing::Values(web_app::InstallationType::INSTALL_TYPE), \
::testing::Values(TestProfileType::kRegular, \
TestProfileType::kIncognito, \
......
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