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

Desktop PWAs: ApkWebAppInstallerBrowserTest cleanup

DesktopPWAsWithoutExtensions has shipped.
We no longer need to use ScopedFeatureList.

Bug: 1065748
Change-Id: I68ebbc4307e295c924f198f7f702cf7718db8283
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2455509
Auto-Submit: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815415}
parent 4117aedf
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/scoped_observer.h" #include "base/scoped_observer.h"
#include "base/test/bind_test_util.h" #include "base/test/bind_test_util.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h" #include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/chromeos/apps/apk_web_app_installer.h" #include "chrome/browser/chromeos/apps/apk_web_app_installer.h"
...@@ -28,9 +27,7 @@ ...@@ -28,9 +27,7 @@
#include "chrome/browser/web_applications/components/app_registrar_observer.h" #include "chrome/browser/web_applications/components/app_registrar_observer.h"
#include "chrome/browser/web_applications/components/install_finalizer.h" #include "chrome/browser/web_applications/components/install_finalizer.h"
#include "chrome/browser/web_applications/components/web_app_id.h" #include "chrome/browser/web_applications/components/web_app_id.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 "components/arc/arc_util.h" #include "components/arc/arc_util.h"
#include "components/arc/test/connection_holder_util.h" #include "components/arc/test/connection_holder_util.h"
#include "components/arc/test/fake_app_instance.h" #include "components/arc/test/fake_app_instance.h"
...@@ -58,21 +55,11 @@ arc::mojom::RawIconPngDataPtr GetFakeIconBytes() { ...@@ -58,21 +55,11 @@ arc::mojom::RawIconPngDataPtr GetFakeIconBytes() {
namespace chromeos { namespace chromeos {
class ApkWebAppInstallerBrowserTest class ApkWebAppInstallerBrowserTest : public InProcessBrowserTest,
: public InProcessBrowserTest,
public web_app::AppRegistrarObserver, public web_app::AppRegistrarObserver,
public ArcAppListPrefs::Observer, public ArcAppListPrefs::Observer {
public ::testing::WithParamInterface<web_app::ProviderType> {
public: public:
ApkWebAppInstallerBrowserTest() { ApkWebAppInstallerBrowserTest() = default;
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);
}
}
void SetUpCommandLine(base::CommandLine* command_line) override { void SetUpCommandLine(base::CommandLine* command_line) override {
arc::SetArcAvailableCommandLineForTesting(command_line); arc::SetArcAvailableCommandLineForTesting(command_line);
...@@ -184,7 +171,6 @@ class ApkWebAppInstallerBrowserTest ...@@ -184,7 +171,6 @@ class ApkWebAppInstallerBrowserTest
} }
protected: protected:
base::test::ScopedFeatureList scoped_feature_list_;
ScopedObserver<web_app::AppRegistrar, web_app::AppRegistrarObserver> ScopedObserver<web_app::AppRegistrar, web_app::AppRegistrarObserver>
observer_{this}; observer_{this};
ArcAppListPrefs* arc_app_list_prefs_ = nullptr; ArcAppListPrefs* arc_app_list_prefs_ = nullptr;
...@@ -228,7 +214,7 @@ class ApkWebAppInstallerWithLauncherControllerBrowserTest ...@@ -228,7 +214,7 @@ class ApkWebAppInstallerWithLauncherControllerBrowserTest
}; };
// Test the full installation and uninstallation flow. // Test the full installation and uninstallation flow.
IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest, InstallAndUninstall) { IN_PROC_BROWSER_TEST_F(ApkWebAppInstallerBrowserTest, InstallAndUninstall) {
ApkWebAppService* service = apk_web_app_service(); ApkWebAppService* service = apk_web_app_service();
service->SetArcAppListPrefsForTesting(arc_app_list_prefs_); service->SetArcAppListPrefsForTesting(arc_app_list_prefs_);
...@@ -267,7 +253,7 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest, InstallAndUninstall) { ...@@ -267,7 +253,7 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest, InstallAndUninstall) {
} }
// Test installation via PackageListRefreshed. // Test installation via PackageListRefreshed.
IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest, PackageListRefreshed) { IN_PROC_BROWSER_TEST_F(ApkWebAppInstallerBrowserTest, PackageListRefreshed) {
ApkWebAppService* service = apk_web_app_service(); ApkWebAppService* service = apk_web_app_service();
service->SetArcAppListPrefsForTesting(arc_app_list_prefs_); service->SetArcAppListPrefsForTesting(arc_app_list_prefs_);
...@@ -287,7 +273,7 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest, PackageListRefreshed) { ...@@ -287,7 +273,7 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest, PackageListRefreshed) {
} }
// Test uninstallation when ARC isn't running. // Test uninstallation when ARC isn't running.
IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerDelayedArcStartBrowserTest, IN_PROC_BROWSER_TEST_F(ApkWebAppInstallerDelayedArcStartBrowserTest,
DelayedUninstall) { DelayedUninstall) {
ApkWebAppService* service = apk_web_app_service(); ApkWebAppService* service = apk_web_app_service();
...@@ -338,7 +324,7 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerDelayedArcStartBrowserTest, ...@@ -338,7 +324,7 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerDelayedArcStartBrowserTest,
} }
// Test an upgrade that becomes a web app and then stops being a web app. // Test an upgrade that becomes a web app and then stops being a web app.
IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest, IN_PROC_BROWSER_TEST_F(ApkWebAppInstallerBrowserTest,
UpgradeToWebAppAndToArcApp) { UpgradeToWebAppAndToArcApp) {
ApkWebAppService* service = apk_web_app_service(); ApkWebAppService* service = apk_web_app_service();
service->SetArcAppListPrefsForTesting(arc_app_list_prefs_); service->SetArcAppListPrefsForTesting(arc_app_list_prefs_);
...@@ -394,7 +380,7 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest, ...@@ -394,7 +380,7 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerBrowserTest,
} }
} }
IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerWithLauncherControllerBrowserTest, IN_PROC_BROWSER_TEST_F(ApkWebAppInstallerWithLauncherControllerBrowserTest,
CheckPinStateAfterUpdate) { CheckPinStateAfterUpdate) {
ApkWebAppService* service = apk_web_app_service(); ApkWebAppService* service = apk_web_app_service();
service->SetArcAppListPrefsForTesting(arc_app_list_prefs_); service->SetArcAppListPrefsForTesting(arc_app_list_prefs_);
...@@ -481,22 +467,4 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerWithLauncherControllerBrowserTest, ...@@ -481,22 +467,4 @@ IN_PROC_BROWSER_TEST_P(ApkWebAppInstallerWithLauncherControllerBrowserTest,
} }
} }
INSTANTIATE_TEST_SUITE_P(All,
ApkWebAppInstallerBrowserTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
INSTANTIATE_TEST_SUITE_P(All,
ApkWebAppInstallerDelayedArcStartBrowserTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
INSTANTIATE_TEST_SUITE_P(All,
ApkWebAppInstallerWithLauncherControllerBrowserTest,
::testing::Values(web_app::ProviderType::kBookmarkApps,
web_app::ProviderType::kWebApps),
web_app::ProviderTypeParamToString);
} // namespace chromeos } // namespace chromeos
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