Commit 6731dc06 authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Define macros to help instantiate system web app manager tests.

The current approach isn't maintainable, and a new param is needed for
better coverage of incognito and guest mode profiles.

Bug: b/166730281
Change-Id: Iea8b7ec6ced3867d83fc5224499830db9c6f53bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2397982
Commit-Queue: Trent Apted <tapted@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: default avatarJiewei Qian  <qjw@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805616}
parent 34d9af8e
...@@ -31,11 +31,5 @@ IN_PROC_BROWSER_TEST_P(DiagnosticsAppIntegrationTest, ...@@ -31,11 +31,5 @@ IN_PROC_BROWSER_TEST_P(DiagnosticsAppIntegrationTest,
web_app::SystemAppType::DIAGNOSTICS, url, "Diagnostics")); web_app::SystemAppType::DIAGNOSTICS, url, "Diagnostics"));
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, DiagnosticsAppIntegrationTest);
DiagnosticsAppIntegrationTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kWebAppInfoInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -398,14 +398,8 @@ IN_PROC_BROWSER_TEST_P(HelpAppIntegrationTest, HelpAppOpenKeyboardShortcut) { ...@@ -398,14 +398,8 @@ IN_PROC_BROWSER_TEST_P(HelpAppIntegrationTest, HelpAppOpenKeyboardShortcut) {
#endif #endif
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, HelpAppIntegrationTest);
HelpAppIntegrationTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kManifestInstall)),
web_app::ProviderAndInstallationTypeToString);
class HelpAppGuestSessionIntegrationTest : public HelpAppIntegrationTest { class HelpAppGuestSessionIntegrationTest : public HelpAppIntegrationTest {
protected: protected:
...@@ -465,11 +459,5 @@ IN_PROC_BROWSER_TEST_P(HelpAppGuestSessionIntegrationTest, ...@@ -465,11 +459,5 @@ IN_PROC_BROWSER_TEST_P(HelpAppGuestSessionIntegrationTest,
WaitForAppToOpen(GURL("chrome://help-app/help/sub/3399710/id/9739838"))); WaitForAppToOpen(GURL("chrome://help-app/help/sub/3399710/id/9739838")));
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, HelpAppGuestSessionIntegrationTest);
HelpAppGuestSessionIntegrationTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kManifestInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -453,20 +453,8 @@ IN_PROC_BROWSER_TEST_P(MediaAppIntegrationWithFilesAppTest, RenameFile) { ...@@ -453,20 +453,8 @@ IN_PROC_BROWSER_TEST_P(MediaAppIntegrationWithFilesAppTest, RenameFile) {
EXPECT_EQ(expected_contents, renamed_contents); EXPECT_EQ(expected_contents, renamed_contents);
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_WEB_APP_INFO_INSTALL_P(
All, MediaAppIntegrationTest);
MediaAppIntegrationTest,
::testing::Combine( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_WEB_APP_INFO_INSTALL_P(
::testing::Values(web_app::ProviderType::kBookmarkApps, MediaAppIntegrationWithFilesAppTest);
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kWebAppInfoInstall)),
web_app::ProviderAndInstallationTypeToString);
INSTANTIATE_TEST_SUITE_P(
All,
MediaAppIntegrationWithFilesAppTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kWebAppInfoInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -30,11 +30,5 @@ IN_PROC_BROWSER_TEST_P(PrintManagementAppIntegrationTest, ...@@ -30,11 +30,5 @@ IN_PROC_BROWSER_TEST_P(PrintManagementAppIntegrationTest,
web_app::SystemAppType::PRINT_MANAGEMENT, url, "Print Jobs")); web_app::SystemAppType::PRINT_MANAGEMENT, url, "Print Jobs"));
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, PrintManagementAppIntegrationTest);
PrintManagementAppIntegrationTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kManifestInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -18,11 +18,5 @@ IN_PROC_BROWSER_TEST_P(SampleSystemWebAppIntegrationTest, SampleSystemWebApp) { ...@@ -18,11 +18,5 @@ IN_PROC_BROWSER_TEST_P(SampleSystemWebAppIntegrationTest, SampleSystemWebApp) {
web_app::SystemAppType::SAMPLE, url, "Sample System Web App")); web_app::SystemAppType::SAMPLE, url, "Sample System Web App"));
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, SampleSystemWebAppIntegrationTest);
SampleSystemWebAppIntegrationTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kWebAppInfoInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -30,11 +30,5 @@ IN_PROC_BROWSER_TEST_P(ScanningAppIntegrationTest, ScanningAppInLauncher) { ...@@ -30,11 +30,5 @@ IN_PROC_BROWSER_TEST_P(ScanningAppIntegrationTest, ScanningAppInLauncher) {
ExpectSystemWebAppValid(web_app::SystemAppType::SCANNING, url, "Scan")); ExpectSystemWebAppValid(web_app::SystemAppType::SCANNING, url, "Scan"));
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, ScanningAppIntegrationTest);
ScanningAppIntegrationTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kWebAppInfoInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -57,11 +57,5 @@ IN_PROC_BROWSER_TEST_P(SettingsAppIntegrationTest, SettingsAppDisabled) { ...@@ -57,11 +57,5 @@ IN_PROC_BROWSER_TEST_P(SettingsAppIntegrationTest, SettingsAppDisabled) {
web_contents->GetTitle()); web_contents->GetTitle());
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, SettingsAppIntegrationTest);
SettingsAppIntegrationTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kManifestInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -91,16 +91,10 @@ class TelemetryExtensionWithDirIntegrationTest ...@@ -91,16 +91,10 @@ class TelemetryExtensionWithDirIntegrationTest
} }
}; };
INSTANTIATE_TEST_SUITE_P( // TODO: Change MANIFEST_INSTALL to ALL_INSTALL_TYPES when a
All, // WebApplicationProvider is ready.
TelemetryExtensionIntegrationTest, INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
::testing::Combine( TelemetryExtensionIntegrationTest);
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
// TODO: Change this ::testing::Value(false) to
// ::testing::Bool() when a WebApplicationProvider is ready
::testing::Values(false)),
web_app::ProviderAndInstallationTypeToString);
// Tests that TelemetryExtensionUntrustedSource can successfully load a resource // Tests that TelemetryExtensionUntrustedSource can successfully load a resource
// from disk. // from disk.
...@@ -138,14 +132,7 @@ IN_PROC_BROWSER_TEST_P( ...@@ -138,14 +132,7 @@ IN_PROC_BROWSER_TEST_P(
content::NavigateToURL(web_contents, non_existent_resource_gurl)); content::NavigateToURL(web_contents, non_existent_resource_gurl));
} }
INSTANTIATE_TEST_SUITE_P( // TODO: Change MANIFEST_INSTALL to ALL_INSTALL_TYPES when a
All, // WebApplicationProvider is ready.
TelemetryExtensionWithDirIntegrationTest, INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
::testing::Combine( TelemetryExtensionWithDirIntegrationTest);
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
// TODO: Change this ::testing::Values(kManifestInstall) to
// ::testing::Values(kManifestInstall, kWebAppInfoInstall) when a
// WebApplicationProvider is ready
::testing::Values(web_app::InstallationType::kManifestInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -340,11 +340,5 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppSessionRestoreTestChromeOS, ...@@ -340,11 +340,5 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppSessionRestoreTestChromeOS,
} }
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, SystemWebAppSessionRestoreTestChromeOS);
SystemWebAppSessionRestoreTestChromeOS,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kManifestInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -43,11 +43,5 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppNonClientFrameViewBrowserTest, ...@@ -43,11 +43,5 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppNonClientFrameViewBrowserTest,
PageActionIconType::kNativeFileSystemAccess)); PageActionIconType::kNativeFileSystemAccess));
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P(
All, SystemWebAppNonClientFrameViewBrowserTest);
SystemWebAppNonClientFrameViewBrowserTest,
::testing::Combine(
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
::testing::Values(web_app::InstallationType::kManifestInstall)),
web_app::ProviderAndInstallationTypeToString);
...@@ -419,13 +419,7 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppLinkCaptureBrowserTest, ...@@ -419,13 +419,7 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppLinkCaptureBrowserTest,
EXPECT_FALSE(app_browser->app_controller()->ShouldShowCustomTabBar()); EXPECT_FALSE(app_browser->app_controller()->ShouldShowCustomTabBar());
} }
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
All, SystemWebAppLinkCaptureBrowserTest);
SystemWebAppLinkCaptureBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
} // namespace web_app } // namespace web_app
...@@ -228,12 +228,10 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerWebAppInfoBrowserTest, Install) { ...@@ -228,12 +228,10 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerWebAppInfoBrowserTest, Install) {
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
} }
// We test with and without enabling kDesktopPWAsWithoutExtensions. std::string SystemWebAppManagerTestParamsToString(
std::string ProviderAndInstallationTypeToString( const ::testing::TestParamInfo<SystemWebAppManagerTestParams>& param_info) {
const ::testing::TestParamInfo<ProviderTypeAndInstallationType>&
provider_type) {
std::string output; std::string output;
switch (std::get<0>(provider_type.param)) { switch (std::get<0>(param_info.param)) {
case ProviderType::kBookmarkApps: case ProviderType::kBookmarkApps:
output.append("BookmarkApps"); output.append("BookmarkApps");
break; break;
...@@ -241,11 +239,9 @@ std::string ProviderAndInstallationTypeToString( ...@@ -241,11 +239,9 @@ std::string ProviderAndInstallationTypeToString(
output.append("WebApps"); output.append("WebApps");
break; break;
} }
if (std::get<1>(provider_type.param) == if (std::get<1>(param_info.param) == InstallationType::kWebAppInfoInstall) {
InstallationType::kWebAppInfoInstall) {
output.append("_WebAppInfoInstall"); output.append("_WebAppInfoInstall");
} }
return output; return output;
} }
...@@ -355,7 +351,7 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerWebAppInfoBrowserTest, ...@@ -355,7 +351,7 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerWebAppInfoBrowserTest,
// policies. // policies.
class SystemWebAppManagerFileHandlingBrowserTestBase class SystemWebAppManagerFileHandlingBrowserTestBase
: public SystemWebAppManagerBrowserTestBase, : public SystemWebAppManagerBrowserTestBase,
public ::testing::WithParamInterface<ProviderTypeAndInstallationType> { public ::testing::WithParamInterface<SystemWebAppManagerTestParams> {
public: public:
using IncludeLaunchDirectory = using IncludeLaunchDirectory =
TestSystemWebAppInstallation::IncludeLaunchDirectory; TestSystemWebAppInstallation::IncludeLaunchDirectory;
...@@ -1511,127 +1507,49 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerAppSuspensionBrowserTest, ...@@ -1511,127 +1507,49 @@ IN_PROC_BROWSER_TEST_P(SystemWebAppManagerAppSuspensionBrowserTest,
GetAppIconKey(*settings_id)->icon_effects); GetAppIconKey(*settings_id)->icon_effects);
} }
// This feature will only work when DesktopPWAsWithoutExtensions launches. // This feature will only work when DesktopPWAsWithoutExtensions launches.
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
All, SystemWebAppManagerAppSuspensionBrowserTest);
SystemWebAppManagerAppSuspensionBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
All, SystemWebAppManagerWebAppInfoBrowserTest);
SystemWebAppManagerWebAppInfoBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps, INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
ProviderType::kWebApps), SystemWebAppManagerLaunchFilesBrowserTest);
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)), INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
ProviderAndInstallationTypeToString); SystemWebAppManagerLaunchDirectoryBrowserTest);
INSTANTIATE_TEST_SUITE_P(
All,
SystemWebAppManagerLaunchFilesBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
INSTANTIATE_TEST_SUITE_P(
All,
SystemWebAppManagerLaunchDirectoryBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
All, SystemWebAppManagerLaunchDirectoryFileSystemProviderBrowserTest);
SystemWebAppManagerLaunchDirectoryFileSystemProviderBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
#endif #endif
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
All, SystemWebAppManagerNotShownInLauncherTest);
SystemWebAppManagerNotShownInLauncherTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps, INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
ProviderType::kWebApps), SystemWebAppManagerNotShownInSearchTest);
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)), INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
ProviderAndInstallationTypeToString); SystemWebAppManagerAdditionalSearchTermsTest);
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
All, SystemWebAppManagerChromeUntrustedTest);
SystemWebAppManagerNotShownInSearchTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps, INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
ProviderType::kWebApps), SystemWebAppManagerOriginTrialsBrowserTest);
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)), INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
ProviderAndInstallationTypeToString); SystemWebAppManagerFileHandlingOriginTrialsBrowserTest);
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
All, SystemWebAppManagerUninstallBrowserTest);
SystemWebAppManagerAdditionalSearchTermsTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
INSTANTIATE_TEST_SUITE_P(
All,
SystemWebAppManagerChromeUntrustedTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
INSTANTIATE_TEST_SUITE_P(
All,
SystemWebAppManagerOriginTrialsBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
INSTANTIATE_TEST_SUITE_P(
All,
SystemWebAppManagerFileHandlingOriginTrialsBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
INSTANTIATE_TEST_SUITE_P(
All,
SystemWebAppManagerUninstallBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
INSTANTIATE_TEST_SUITE_P( INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P(
All, SystemWebAppManagerUpgradeBrowserTest);
SystemWebAppManagerUpgradeBrowserTest,
::testing::Combine(::testing::Values(ProviderType::kBookmarkApps,
ProviderType::kWebApps),
::testing::Values(InstallationType::kManifestInstall,
InstallationType::kWebAppInfoInstall)),
ProviderAndInstallationTypeToString);
#endif #endif
} // namespace web_app } // namespace web_app
...@@ -102,18 +102,16 @@ class SystemWebAppManagerBrowserTestBase : public InProcessBrowserTest { ...@@ -102,18 +102,16 @@ class SystemWebAppManagerBrowserTestBase : public InProcessBrowserTest {
enum class InstallationType { kManifestInstall, kWebAppInfoInstall }; enum class InstallationType { kManifestInstall, kWebAppInfoInstall };
using ProviderTypeAndInstallationType = using SystemWebAppManagerTestParams =
std::tuple<web_app::ProviderType, InstallationType>; std::tuple<ProviderType, InstallationType>;
class SystemWebAppManagerBrowserTest class SystemWebAppManagerBrowserTest
: public SystemWebAppManagerBrowserTestBase, : public SystemWebAppManagerBrowserTestBase,
public ::testing::WithParamInterface<ProviderTypeAndInstallationType> { public ::testing::WithParamInterface<SystemWebAppManagerTestParams> {
public: public:
explicit SystemWebAppManagerBrowserTest(bool install_mock = true); explicit SystemWebAppManagerBrowserTest(bool install_mock = true);
~SystemWebAppManagerBrowserTest() override = default; ~SystemWebAppManagerBrowserTest() override = default;
web_app::ProviderType provider_type() const { ProviderType provider_type() const { return std::get<0>(GetParam()); }
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<1>(GetParam()) == InstallationType::kWebAppInfoInstall;
} }
...@@ -124,9 +122,41 @@ class SystemWebAppManagerBrowserTest ...@@ -124,9 +122,41 @@ class SystemWebAppManagerBrowserTest
using SystemWebAppManagerWebAppInfoBrowserTest = SystemWebAppManagerBrowserTest; using SystemWebAppManagerWebAppInfoBrowserTest = SystemWebAppManagerBrowserTest;
std::string ProviderAndInstallationTypeToString( std::string SystemWebAppManagerTestParamsToString(
const ::testing::TestParamInfo<ProviderTypeAndInstallationType>& const ::testing::TestParamInfo<SystemWebAppManagerTestParams>& param_info);
provider_type);
} // namespace web_app } // namespace web_app
#define INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_P(SUITE, PARAMS) \
INSTANTIATE_TEST_SUITE_P(All, SUITE, PARAMS, \
web_app::SystemWebAppManagerTestParamsToString)
#define INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_ALL_INSTALL_TYPES_P( \
SUITE) \
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)))
#define INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_MANIFEST_INSTALL_P( \
SUITE) \
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)))
#define INSTANTIATE_SYSTEM_WEB_APP_MANAGER_TEST_SUITE_WEB_APP_INFO_INSTALL_P( \
SUITE) \
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)))
#endif // CHROME_BROWSER_WEB_APPLICATIONS_SYSTEM_WEB_APP_MANAGER_BROWSERTEST_H_ #endif // CHROME_BROWSER_WEB_APPLICATIONS_SYSTEM_WEB_APP_MANAGER_BROWSERTEST_H_
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