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) { ...@@ -80,8 +80,7 @@ apps::AppServiceProxy* GetAppServiceProxy(Profile* profile) {
namespace web_app { namespace web_app {
SystemWebAppManagerBrowserTestBase::SystemWebAppManagerBrowserTestBase( SystemWebAppManagerBrowserTestBase::SystemWebAppManagerBrowserTestBase(
bool install_mock) { bool install_mock) {}
}
SystemWebAppManagerBrowserTestBase::~SystemWebAppManagerBrowserTestBase() = SystemWebAppManagerBrowserTestBase::~SystemWebAppManagerBrowserTestBase() =
default; default;
...@@ -181,13 +180,6 @@ GURL SystemWebAppManagerBrowserTestBase::GetStartUrl( ...@@ -181,13 +180,6 @@ GURL SystemWebAppManagerBrowserTestBase::GetStartUrl(
SystemWebAppManagerBrowserTest::SystemWebAppManagerBrowserTest( SystemWebAppManagerBrowserTest::SystemWebAppManagerBrowserTest(
bool install_mock) bool install_mock)
: SystemWebAppManagerBrowserTestBase(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) { if (install_mock) {
maybe_installation_ = maybe_installation_ =
TestSystemWebAppInstallation::SetUpStandaloneSingleWindowApp( TestSystemWebAppInstallation::SetUpStandaloneSingleWindowApp(
...@@ -254,18 +246,11 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerWebAppInfoBrowserTest, Install) { ...@@ -254,18 +246,11 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerWebAppInfoBrowserTest, Install) {
std::string SystemWebAppManagerTestParamsToString( std::string SystemWebAppManagerTestParamsToString(
const ::testing::TestParamInfo<SystemWebAppManagerTestParams>& param_info) { const ::testing::TestParamInfo<SystemWebAppManagerTestParams>& param_info) {
std::string output; std::string output;
switch (std::get<0>(param_info.param)) {
case ProviderType::kBookmarkApps: if (std::get<0>(param_info.param) == InstallationType::kWebAppInfoInstall) {
output.append("BookmarkApps");
break;
case ProviderType::kWebApps:
output.append("WebApps");
break;
}
if (std::get<1>(param_info.param) == InstallationType::kWebAppInfoInstall) {
output.append("_WebAppInfoInstall"); output.append("_WebAppInfoInstall");
} }
switch (std::get<2>(param_info.param)) { switch (std::get<1>(param_info.param)) {
case TestProfileType::kRegular: case TestProfileType::kRegular:
break; break;
case TestProfileType::kIncognito: case TestProfileType::kIncognito:
...@@ -275,6 +260,10 @@ std::string SystemWebAppManagerTestParamsToString( ...@@ -275,6 +260,10 @@ std::string SystemWebAppManagerTestParamsToString(
output.append("_Guest"); output.append("_Guest");
break; break;
} }
// The framework doesn't accept a blank param
if (output.empty()) {
output = "_Default";
}
return output; return output;
} }
...@@ -390,22 +379,13 @@ class SystemWebAppManagerFileHandlingBrowserTestBase ...@@ -390,22 +379,13 @@ class SystemWebAppManagerFileHandlingBrowserTestBase
explicit SystemWebAppManagerFileHandlingBrowserTestBase( explicit SystemWebAppManagerFileHandlingBrowserTestBase(
IncludeLaunchDirectory include_launch_directory) IncludeLaunchDirectory include_launch_directory)
: SystemWebAppManagerBrowserTestBase(/*install_mock=*/false) { : 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( scoped_feature_blink_api_.InitWithFeatures(
{blink::features::kFileHandlingAPI}, {}); {blink::features::kFileHandlingAPI}, {});
maybe_installation_ = maybe_installation_ =
TestSystemWebAppInstallation::SetUpAppThatReceivesLaunchFiles( TestSystemWebAppInstallation::SetUpAppThatReceivesLaunchFiles(
include_launch_directory, include_launch_directory,
std::get<1>(GetParam()) == InstallationType::kWebAppInfoInstall); std::get<0>(GetParam()) == InstallationType::kWebAppInfoInstall);
} }
content::WebContents* LaunchApp( content::WebContents* LaunchApp(
......
...@@ -99,15 +99,12 @@ class SystemWebAppManagerBrowserTestBase : public InProcessBrowserTest { ...@@ -99,15 +99,12 @@ class SystemWebAppManagerBrowserTestBase : public InProcessBrowserTest {
content::WebContents* LaunchApp(const apps::AppLaunchParams& params, content::WebContents* LaunchApp(const apps::AppLaunchParams& params,
bool wait_for_load, bool wait_for_load,
Browser** out_browser); Browser** out_browser);
base::test::ScopedFeatureList scoped_feature_list_;
}; };
enum class InstallationType { kManifestInstall, kWebAppInfoInstall }; enum class InstallationType { kManifestInstall, kWebAppInfoInstall };
using SystemWebAppManagerTestParams = using SystemWebAppManagerTestParams =
std::tuple<ProviderType, InstallationType, TestProfileType>; std::tuple<InstallationType, TestProfileType>;
class SystemWebAppManagerBrowserTest class SystemWebAppManagerBrowserTest
: public SystemWebAppManagerBrowserTestBase, : public SystemWebAppManagerBrowserTestBase,
...@@ -116,17 +113,13 @@ class SystemWebAppManagerBrowserTest ...@@ -116,17 +113,13 @@ class SystemWebAppManagerBrowserTest
explicit SystemWebAppManagerBrowserTest(bool install_mock = true); explicit SystemWebAppManagerBrowserTest(bool install_mock = true);
~SystemWebAppManagerBrowserTest() override = default; ~SystemWebAppManagerBrowserTest() override = default;
ProviderType provider_type() const { return std::get<0>(GetParam()); }
bool install_from_web_app_info() const { 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: // InProcessBrowserTest:
void SetUpCommandLine(base::CommandLine* command_line) override; void SetUpCommandLine(base::CommandLine* command_line) override;
private:
base::test::ScopedFeatureList scoped_feature_list_;
}; };
using SystemWebAppManagerWebAppInfoBrowserTest = SystemWebAppManagerBrowserTest; using SystemWebAppManagerWebAppInfoBrowserTest = SystemWebAppManagerBrowserTest;
...@@ -145,8 +138,6 @@ std::string SystemWebAppManagerTestParamsToString( ...@@ -145,8 +138,6 @@ std::string SystemWebAppManagerTestParamsToString(
INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \ INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \
SUITE, \ SUITE, \
::testing::Combine( \ ::testing::Combine( \
::testing::Values(web_app::ProviderType::kBookmarkApps, \
web_app::ProviderType::kWebApps), \
::testing::Values(web_app::InstallationType::kManifestInstall, \ ::testing::Values(web_app::InstallationType::kManifestInstall, \
web_app::InstallationType::kWebAppInfoInstall), \ web_app::InstallationType::kWebAppInfoInstall), \
::testing::Values(TestProfileType::kRegular))) ::testing::Values(TestProfileType::kRegular)))
...@@ -156,8 +147,6 @@ std::string SystemWebAppManagerTestParamsToString( ...@@ -156,8 +147,6 @@ std::string SystemWebAppManagerTestParamsToString(
INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \ INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \
SUITE, \ SUITE, \
::testing::Combine( \ ::testing::Combine( \
::testing::Values(web_app::ProviderType::kBookmarkApps, \
web_app::ProviderType::kWebApps), \
::testing::Values(web_app::InstallationType::kManifestInstall), \ ::testing::Values(web_app::InstallationType::kManifestInstall), \
::testing::Values(TestProfileType::kRegular))) ::testing::Values(TestProfileType::kRegular)))
...@@ -166,8 +155,6 @@ std::string SystemWebAppManagerTestParamsToString( ...@@ -166,8 +155,6 @@ std::string SystemWebAppManagerTestParamsToString(
INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \ INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \
SUITE, \ SUITE, \
::testing::Combine( \ ::testing::Combine( \
::testing::Values(web_app::ProviderType::kBookmarkApps, \
web_app::ProviderType::kWebApps), \
::testing::Values(web_app::InstallationType::kWebAppInfoInstall), \ ::testing::Values(web_app::InstallationType::kWebAppInfoInstall), \
::testing::Values(TestProfileType::kRegular))) ::testing::Values(TestProfileType::kRegular)))
...@@ -181,8 +168,6 @@ std::string SystemWebAppManagerTestParamsToString( ...@@ -181,8 +168,6 @@ std::string SystemWebAppManagerTestParamsToString(
SUITE, INSTALL_TYPE) \ SUITE, INSTALL_TYPE) \
INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \ INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P( \
SUITE, ::testing::Combine( \ SUITE, ::testing::Combine( \
::testing::Values(web_app::ProviderType::kBookmarkApps, \
web_app::ProviderType::kWebApps), \
::testing::Values(web_app::InstallationType::INSTALL_TYPE), \ ::testing::Values(web_app::InstallationType::INSTALL_TYPE), \
::testing::Values(TestProfileType::kRegular, \ ::testing::Values(TestProfileType::kRegular, \
TestProfileType::kIncognito, \ 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