Remove code path of --arc-start-mode=always-start
* Remove callers to SetArcAlwaysStartForTesting(true)
* Change the remaining SetArcAlwaysStartForTesting(false) to
SetArcAlwaysStartWithoutPlayStoreForTesting()
TEST=out/Cleanup/unit_tests --gtest_filter=ChromeLauncherController*: \
Arc*:NoteTakingHelperTest*
BUG=b:69960761
[email protected], [email protected]
Change-Id: I0bbb0774c005db62c346fcfd40f57d897ec86877
Reviewed-on: https://chromium-review.googlesource.com/c/1352495
Commit-Queue: Victor Hsieh <[email protected]>
Reviewed-by: Alexander Alekseev <[email protected]>
Reviewed-by: Yusuke Sato <[email protected]>
Reviewed-by: Yury Khmel <[email protected]>
Cr-Commit-Position: refs/heads/master@{#611816}
diff --git a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
index d430611..78b7839 100644
--- a/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
+++ b/chrome/browser/chromeos/arc/arc_session_manager_unittest.cc
@@ -894,7 +894,7 @@
ArcSessionManagerArcAlwaysStartTest() = default;
void SetUp() override {
- SetArcAlwaysStartForTesting(false);
+ SetArcAlwaysStartWithoutPlayStoreForTesting();
ArcSessionManagerTest::SetUp();
}
diff --git a/chrome/browser/chromeos/note_taking_helper_unittest.cc b/chrome/browser/chromeos/note_taking_helper_unittest.cc
index 6d0cdddc..509208e4 100644
--- a/chrome/browser/chromeos/note_taking_helper_unittest.cc
+++ b/chrome/browser/chromeos/note_taking_helper_unittest.cc
@@ -193,16 +193,12 @@
} // namespace
-class NoteTakingHelperTest : public BrowserWithTestWindowTest,
- public ::testing::WithParamInterface<bool> {
+class NoteTakingHelperTest : public BrowserWithTestWindowTest {
public:
NoteTakingHelperTest() = default;
~NoteTakingHelperTest() override = default;
void SetUp() override {
- if (GetParam())
- arc::SetArcAlwaysStartForTesting(true);
-
// This is needed to avoid log spam due to ArcSessionManager's
// RemoveArcData() calls failing.
if (DBusThreadManager::IsInitialized())
@@ -520,9 +516,7 @@
DISALLOW_COPY_AND_ASSIGN(NoteTakingHelperTest);
};
-INSTANTIATE_TEST_CASE_P(, NoteTakingHelperTest, ::testing::Bool());
-
-TEST_P(NoteTakingHelperTest, PaletteNotEnabled) {
+TEST_F(NoteTakingHelperTest, PaletteNotEnabled) {
// Without the palette enabled, IsAppAvailable() should return false.
Init(0);
scoped_refptr<const extensions::Extension> extension =
@@ -531,7 +525,7 @@
EXPECT_FALSE(helper()->IsAppAvailable(profile()));
}
-TEST_P(NoteTakingHelperTest, ListChromeApps) {
+TEST_F(NoteTakingHelperTest, ListChromeApps) {
Init(ENABLE_PALETTE);
// Start out without any note-taking apps installed.
@@ -590,7 +584,7 @@
true /*preferred*/, NoteTakingLockScreenSupport::kNotSupported}));
}
-TEST_P(NoteTakingHelperTest, ListChromeAppsWithLockScreenNotesSupported) {
+TEST_F(NoteTakingHelperTest, ListChromeAppsWithLockScreenNotesSupported) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
ASSERT_FALSE(helper()->IsAppAvailable(profile()));
@@ -629,7 +623,7 @@
EXPECT_TRUE(helper()->GetPreferredChromeAppInfo(profile()));
}
-TEST_P(NoteTakingHelperTest, PreferredAppEnabledOnLockScreen) {
+TEST_F(NoteTakingHelperTest, PreferredAppEnabledOnLockScreen) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
ASSERT_FALSE(helper()->IsAppAvailable(profile()));
@@ -673,7 +667,7 @@
true /*preferred*/, NoteTakingLockScreenSupport::kSupported}));
}
-TEST_P(NoteTakingHelperTest, PreferredAppWithNoLockScreenPermission) {
+TEST_F(NoteTakingHelperTest, PreferredAppWithNoLockScreenPermission) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
ASSERT_FALSE(helper()->IsAppAvailable(profile()));
@@ -697,7 +691,7 @@
true /*preferred*/, NoteTakingLockScreenSupport::kNotSupported}));
}
-TEST_P(NoteTakingHelperTest,
+TEST_F(NoteTakingHelperTest,
PreferredAppWithotLockSupportClearsLockScreenPref) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
@@ -749,7 +743,7 @@
NoteTakingLockScreenSupport::kNotSupported}));
}
-TEST_P(NoteTakingHelperTest,
+TEST_F(NoteTakingHelperTest,
PreferredAppEnabledOnLockScreen_LockScreenAppsNotEnabled) {
Init(ENABLE_PALETTE);
@@ -770,7 +764,7 @@
}
// Verify that lock screen apps are not supported if the feature is not enabled.
-TEST_P(NoteTakingHelperTest, LockScreenAppsSupportNotEnabled) {
+TEST_F(NoteTakingHelperTest, LockScreenAppsSupportNotEnabled) {
Init(ENABLE_PALETTE);
ASSERT_FALSE(helper()->IsAppAvailable(profile()));
@@ -788,7 +782,7 @@
// Verify the note helper detects apps with "new_note" "action_handler" manifest
// entries.
-TEST_P(NoteTakingHelperTest, CustomChromeApps) {
+TEST_F(NoteTakingHelperTest, CustomChromeApps) {
Init(ENABLE_PALETTE);
const extensions::ExtensionId kNewNoteId = crx_file::id_util::GenerateId("a");
@@ -821,7 +815,7 @@
}
// Verify that non-whitelisted apps cannot be enabled on lock screen.
-TEST_P(NoteTakingHelperTest, CustomLockScreenEnabledApps) {
+TEST_F(NoteTakingHelperTest, CustomLockScreenEnabledApps) {
Init(ENABLE_PALETTE & ENABLE_LOCK_SCREEN_APPS);
const extensions::ExtensionId kNewNoteId = crx_file::id_util::GenerateId("a");
@@ -835,7 +829,7 @@
NoteTakingLockScreenSupport::kNotSupported}}));
}
-TEST_P(NoteTakingHelperTest, WhitelistedAndCustomAppsShowOnlyOnce) {
+TEST_F(NoteTakingHelperTest, WhitelistedAndCustomAppsShowOnlyOnce) {
Init(ENABLE_PALETTE);
scoped_refptr<const extensions::Extension> extension = CreateExtension(
@@ -851,7 +845,7 @@
NoteTakingLockScreenSupport::kNotSupported}}));
}
-TEST_P(NoteTakingHelperTest, LaunchChromeApp) {
+TEST_F(NoteTakingHelperTest, LaunchChromeApp) {
Init(ENABLE_PALETTE);
scoped_refptr<const extensions::Extension> extension =
CreateExtension(NoteTakingHelper::kProdKeepExtensionId, "Keep");
@@ -874,7 +868,7 @@
static_cast<int>(LaunchResult::CHROME_SUCCESS), 1);
}
-TEST_P(NoteTakingHelperTest, FallBackIfPreferredAppUnavailable) {
+TEST_F(NoteTakingHelperTest, FallBackIfPreferredAppUnavailable) {
Init(ENABLE_PALETTE);
scoped_refptr<const extensions::Extension> prod_extension =
CreateExtension(NoteTakingHelper::kProdKeepExtensionId, "prod");
@@ -913,13 +907,11 @@
static_cast<int>(LaunchResult::CHROME_SUCCESS), 1);
}
-TEST_P(NoteTakingHelperTest, PlayStoreInitiallyDisabled) {
+TEST_F(NoteTakingHelperTest, PlayStoreInitiallyDisabled) {
Init(ENABLE_PALETTE);
EXPECT_FALSE(helper()->play_store_enabled());
EXPECT_FALSE(helper()->android_apps_received());
- // TODO(victorhsieh): Implement opt-in.
- if (arc::ShouldArcAlwaysStart())
- return;
+
// When Play Store is enabled, the helper's members should be updated
// accordingly.
profile()->GetPrefs()->SetBoolean(arc::prefs::kArcEnabled, true);
@@ -934,7 +926,7 @@
EXPECT_TRUE(helper()->android_apps_received());
}
-TEST_P(NoteTakingHelperTest, AddProfileWithPlayStoreEnabled) {
+TEST_F(NoteTakingHelperTest, AddProfileWithPlayStoreEnabled) {
Init(ENABLE_PALETTE);
EXPECT_FALSE(helper()->play_store_enabled());
EXPECT_FALSE(helper()->android_apps_received());
@@ -973,7 +965,7 @@
profile_manager()->DeleteTestingProfile(kSecondProfileName);
}
-TEST_P(NoteTakingHelperTest, ListAndroidApps) {
+TEST_F(NoteTakingHelperTest, ListAndroidApps) {
// Add two Android apps.
std::vector<IntentHandlerInfoPtr> handlers;
const std::string kName1 = "App 1";
@@ -1012,10 +1004,6 @@
NoteTakingLockScreenSupport::kNotSupported}}));
EXPECT_FALSE(helper()->GetPreferredChromeAppInfo(profile()));
- // TODO(victorhsieh): Opt-out on Persistent ARC is special. Skip until
- // implemented.
- if (arc::ShouldArcAlwaysStart())
- return;
// Disable Play Store and check that the apps are no longer returned.
profile()->GetPrefs()->SetBoolean(arc::prefs::kArcEnabled, false);
EXPECT_FALSE(helper()->play_store_enabled());
@@ -1024,7 +1012,7 @@
EXPECT_TRUE(helper()->GetAvailableApps(profile()).empty());
}
-TEST_P(NoteTakingHelperTest, LaunchAndroidApp) {
+TEST_F(NoteTakingHelperTest, LaunchAndroidApp) {
const std::string kPackage1 = "org.chromium.package1";
std::vector<IntentHandlerInfoPtr> handlers;
handlers.emplace_back(CreateIntentHandlerInfo("App 1", kPackage1));
@@ -1074,7 +1062,7 @@
NoteTakingHelper::kDefaultLaunchResultHistogramName, 0);
}
-TEST_P(NoteTakingHelperTest, LaunchAndroidAppWithPath) {
+TEST_F(NoteTakingHelperTest, LaunchAndroidAppWithPath) {
const std::string kPackage = "org.chromium.package";
std::vector<IntentHandlerInfoPtr> handlers;
handlers.emplace_back(CreateIntentHandlerInfo("App", kPackage));
@@ -1117,7 +1105,7 @@
static_cast<int>(LaunchResult::ANDROID_FAILED_TO_CONVERT_PATH), 1);
}
-TEST_P(NoteTakingHelperTest, NoAppsAvailable) {
+TEST_F(NoteTakingHelperTest, NoAppsAvailable) {
Init(ENABLE_PALETTE | ENABLE_PLAY_STORE);
// When no note-taking apps are installed, the histograms should just be
@@ -1132,7 +1120,7 @@
static_cast<int>(LaunchResult::NO_APPS_AVAILABLE), 1);
}
-TEST_P(NoteTakingHelperTest, NotifyObserverAboutAndroidApps) {
+TEST_F(NoteTakingHelperTest, NotifyObserverAboutAndroidApps) {
Init(ENABLE_PALETTE | ENABLE_PLAY_STORE);
TestObserver observer;
@@ -1140,11 +1128,6 @@
base::RunLoop().RunUntilIdle();
EXPECT_EQ(1, observer.num_updates());
- // TODO(victorhsieh): Opt-out on Persistent ARC is special. Skip until
- // implemented.
- if (arc::ShouldArcAlwaysStart())
- return;
-
// Disabling and enabling Play Store should also notify the observer (and
// enabling should request apps again).
profile()->GetPrefs()->SetBoolean(arc::prefs::kArcEnabled, false);
@@ -1162,7 +1145,7 @@
EXPECT_EQ(4, observer.num_updates());
}
-TEST_P(NoteTakingHelperTest, NotifyObserverAboutChromeApps) {
+TEST_F(NoteTakingHelperTest, NotifyObserverAboutChromeApps) {
Init(ENABLE_PALETTE);
TestObserver observer;
ASSERT_EQ(0, observer.num_updates());
@@ -1201,7 +1184,7 @@
profile_manager()->DeleteTestingProfile(kSecondProfileName);
}
-TEST_P(NoteTakingHelperTest, NotifyObserverAboutPreferredAppChanges) {
+TEST_F(NoteTakingHelperTest, NotifyObserverAboutPreferredAppChanges) {
Init(ENABLE_PALETTE);
TestObserver observer;
@@ -1266,7 +1249,7 @@
profile_manager()->DeleteTestingProfile(kSecondProfileName);
}
-TEST_P(NoteTakingHelperTest,
+TEST_F(NoteTakingHelperTest,
NotifyObserverAboutPreferredAppLockScreenSupportChanges) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
TestObserver observer;
@@ -1316,7 +1299,7 @@
EXPECT_TRUE(observer.preferred_app_updates().empty());
}
-TEST_P(NoteTakingHelperTest, SetAppEnabledOnLockScreen) {
+TEST_F(NoteTakingHelperTest, SetAppEnabledOnLockScreen) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
TestObserver observer;
@@ -1427,7 +1410,7 @@
EXPECT_TRUE(observer.preferred_app_updates().empty());
}
-TEST_P(NoteTakingHelperTest,
+TEST_F(NoteTakingHelperTest,
UpdateLockScreenSupportStatusWhenWhitelistPolicyRemoved) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
TestObserver observer;
@@ -1471,7 +1454,7 @@
true /*preferred*/, NoteTakingLockScreenSupport::kEnabled}}));
}
-TEST_P(NoteTakingHelperTest,
+TEST_F(NoteTakingHelperTest,
NoObserverCallsIfPolicyChangesBeforeLockScreenStatusIsFetched) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
TestObserver observer;
@@ -1504,7 +1487,7 @@
true /*preferred*/, NoteTakingLockScreenSupport::kEnabled}}));
}
-TEST_P(NoteTakingHelperTest, LockScreenSupportInSecondaryProfile) {
+TEST_F(NoteTakingHelperTest, LockScreenSupportInSecondaryProfile) {
Init(ENABLE_PALETTE | ENABLE_LOCK_SCREEN_APPS);
TestObserver observer;
@@ -1567,7 +1550,7 @@
true /*preferred*/, NoteTakingLockScreenSupport::kNotSupported}));
}
-TEST_P(NoteTakingHelperTest, NoteTakingControllerClient) {
+TEST_F(NoteTakingHelperTest, NoteTakingControllerClient) {
Init(ENABLE_PALETTE);
auto has_note_taking_apps = [&]() {
diff --git a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
index e2dc8fb..426cbc4 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
@@ -148,39 +148,26 @@
enum class ArcState {
// By default, ARC is non-persistent and Play Store is unmanaged.
ARC_PLAY_STORE_UNMANAGED,
- // ARC is persistent and Play Store is unmanaged
- ARC_PERSISTENT_PLAY_STORE_UNMANAGED,
// ARC is non-persistent and Play Store is managed and enabled.
ARC_PLAY_STORE_MANAGED_AND_ENABLED,
// ARC is non-persistent and Play Store is managed and disabled.
ARC_PLAY_STORE_MANAGED_AND_DISABLED,
- // ARC is persistent and Play Store is managed and enabled.
- ARC_PERSISTENT_PLAY_STORE_MANAGED_AND_ENABLED,
- // ARC is persistent and Play Store is managed and disabled.
- ARC_PERSISTENT_PLAY_STORE_MANAGED_AND_DISABLED,
// ARC is persistent but without Play Store UI support.
- ARC_PERSISTENT_WITHOUT_PLAY_STORE,
- // ARC is persistent, Play Store is managed, enabled, but hidden.
- ARC_PERSISTENT_MANAGED_ENABLED_AND_PLAY_STORE_HIDDEN,
+ ARC_WITHOUT_PLAY_STORE,
};
constexpr ArcState kManagedArcStates[] = {
ArcState::ARC_PLAY_STORE_MANAGED_AND_ENABLED,
ArcState::ARC_PLAY_STORE_MANAGED_AND_DISABLED,
- ArcState::ARC_PERSISTENT_PLAY_STORE_MANAGED_AND_ENABLED,
- ArcState::ARC_PERSISTENT_PLAY_STORE_MANAGED_AND_DISABLED,
- ArcState::ARC_PERSISTENT_MANAGED_ENABLED_AND_PLAY_STORE_HIDDEN,
};
constexpr ArcState kUnmanagedArcStates[] = {
ArcState::ARC_PLAY_STORE_UNMANAGED,
- ArcState::ARC_PERSISTENT_PLAY_STORE_UNMANAGED,
- ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE,
+ ArcState::ARC_WITHOUT_PLAY_STORE,
};
constexpr ArcState kUnmanagedArcStatesWithPlayStore[] = {
ArcState::ARC_PLAY_STORE_UNMANAGED,
- ArcState::ARC_PERSISTENT_PLAY_STORE_UNMANAGED,
};
void OnPaiStartedCallback(bool* started_flag) {
@@ -211,18 +198,8 @@
}
void SetUp() override {
- switch (GetParam()) {
- case ArcState::ARC_PERSISTENT_PLAY_STORE_UNMANAGED:
- case ArcState::ARC_PERSISTENT_PLAY_STORE_MANAGED_AND_ENABLED:
- case ArcState::ARC_PERSISTENT_PLAY_STORE_MANAGED_AND_DISABLED:
- case ArcState::ARC_PERSISTENT_MANAGED_ENABLED_AND_PLAY_STORE_HIDDEN:
- arc::SetArcAlwaysStartForTesting(true);
- break;
- case ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE:
- arc::SetArcAlwaysStartForTesting(false);
- break;
- default:
- break;
+ if (GetParam() == ArcState::ARC_WITHOUT_PLAY_STORE) {
+ arc::SetArcAlwaysStartWithoutPlayStoreForTesting();
}
extensions::ExtensionServiceTestBase::SetUp();
@@ -598,7 +575,7 @@
app.name = "Play Store";
app.package_name = arc::kPlayStorePackage;
app.activity = arc::kPlayStoreActivity;
- app.sticky = GetParam() != ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE;
+ app.sticky = GetParam() != ArcState::ARC_WITHOUT_PLAY_STORE;
app_instance()->RefreshAppList();
app_instance()->SendRefreshAppList({app});
@@ -619,12 +596,8 @@
bool IsEnabledByPolicy() const {
switch (GetParam()) {
case ArcState::ARC_PLAY_STORE_MANAGED_AND_ENABLED:
- case ArcState::ARC_PERSISTENT_PLAY_STORE_MANAGED_AND_ENABLED:
- case ArcState::ARC_PERSISTENT_MANAGED_ENABLED_AND_PLAY_STORE_HIDDEN:
- return true;
case ArcState::ARC_PLAY_STORE_MANAGED_AND_DISABLED:
- case ArcState::ARC_PERSISTENT_PLAY_STORE_MANAGED_AND_DISABLED:
- case ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE:
+ case ArcState::ARC_WITHOUT_PLAY_STORE:
return false;
default:
NOTREACHED();
@@ -634,13 +607,6 @@
// ArcPlayStoreAppTest:
void OnBeforeArcTestSetup() override {
- if (GetParam() ==
- ArcState::ARC_PERSISTENT_MANAGED_ENABLED_AND_PLAY_STORE_HIDDEN) {
- const AccountId account_id(
- AccountId::FromUserEmail(profile_->GetProfileUserName()));
- arc_test()->GetUserManager()->AddPublicAccountUser(account_id);
- arc_test()->GetUserManager()->LoginUser(account_id);
- }
policy::ProfilePolicyConnector* const connector =
policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile());
connector->OverrideIsManagedForTesting(true);
@@ -1339,7 +1305,7 @@
std::unique_ptr<ArcAppListPrefs::AppInfo> app_info =
prefs->GetApp(arc::kPlayStoreAppId);
- if (GetParam() != ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE) {
+ if (GetParam() != ArcState::ARC_WITHOUT_PLAY_STORE) {
// Make sure PlayStore is available.
ASSERT_TRUE(app_info);
EXPECT_FALSE(app_info->ready);
@@ -1392,7 +1358,7 @@
ASSERT_TRUE(session_manager);
// PAI starter is not expected for ARC without the Play Store.
- if (GetParam() == ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE) {
+ if (GetParam() == ArcState::ARC_WITHOUT_PLAY_STORE) {
EXPECT_FALSE(session_manager->pai_starter());
return;
}
@@ -1429,7 +1395,7 @@
// Validates that PAI is started on the next session start if it was not started
// during the previous sessions for some reason.
TEST_P(ArcPlayStoreAppTest, StartPaiOnNextRun) {
- if (GetParam() == ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE)
+ if (GetParam() == ArcState::ARC_WITHOUT_PLAY_STORE)
return;
arc::ArcSessionManager* session_manager = arc::ArcSessionManager::Get();
@@ -1520,7 +1486,7 @@
ASSERT_TRUE(session_manager);
// Fast App Reinstall starter is not expected for ARC without the Play Store.
- if (GetParam() == ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE) {
+ if (GetParam() == ArcState::ARC_WITHOUT_PLAY_STORE) {
EXPECT_FALSE(session_manager->fast_app_resintall_starter());
return;
}
@@ -1566,7 +1532,7 @@
ASSERT_TRUE(session_manager);
// Fast App Reinstall starter is not expected for ARC without the Play Store.
- if (GetParam() == ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE) {
+ if (GetParam() == ArcState::ARC_WITHOUT_PLAY_STORE) {
EXPECT_FALSE(session_manager->fast_app_resintall_starter());
return;
}
@@ -2379,7 +2345,7 @@
std::vector<arc::mojom::AppInfo> expected_apps(fake_default_apps());
ValidateHaveApps(expected_apps);
- if (GetParam() == ArcState::ARC_PERSISTENT_WITHOUT_PLAY_STORE) {
+ if (GetParam() == ArcState::ARC_WITHOUT_PLAY_STORE) {
prefs->SimulateDefaultAppAvailabilityTimeoutForTesting();
ValidateHaveApps(std::vector<arc::mojom::AppInfo>());
return;
@@ -2472,9 +2438,7 @@
// PlayStor exists for managed and enabled state.
std::unique_ptr<ArcAppListPrefs::AppInfo> app_info =
prefs->GetApp(arc::kPlayStoreAppId);
- if (IsEnabledByPolicy() &&
- GetParam() !=
- ArcState::ARC_PERSISTENT_MANAGED_ENABLED_AND_PLAY_STORE_HIDDEN) {
+ if (IsEnabledByPolicy()) {
ASSERT_TRUE(app_info);
EXPECT_FALSE(app_info->ready);
} else {
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
index bb903b0..7a6f568 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc
@@ -1089,16 +1089,12 @@
};
class ChromeLauncherControllerWithArcTest
- : public ChromeLauncherControllerTest,
- public ::testing::WithParamInterface<bool> {
+ : public ChromeLauncherControllerTest {
protected:
ChromeLauncherControllerWithArcTest() { auto_start_arc_test_ = true; }
~ChromeLauncherControllerWithArcTest() override {}
void SetUp() override {
- if (GetParam())
- arc::SetArcAlwaysStartForTesting(true);
-
// To prevent crash on test exit and pending decode request.
ArcAppIcon::DisableSafeDecodingForTesting();
@@ -1109,10 +1105,6 @@
DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerWithArcTest);
};
-INSTANTIATE_TEST_CASE_P(,
- ChromeLauncherControllerWithArcTest,
- ::testing::Bool());
-
// Watches WebContents and blocks until it is destroyed. This is needed for
// the destruction of a V2 application.
class WebContentsDestroyedWatcher : public content::WebContentsObserver {
@@ -1339,28 +1331,17 @@
};
class ChromeLauncherControllerMultiProfileWithArcTest
- : public MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest,
- public ::testing::WithParamInterface<bool> {
+ : public MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest {
protected:
ChromeLauncherControllerMultiProfileWithArcTest() {
auto_start_arc_test_ = true;
}
~ChromeLauncherControllerMultiProfileWithArcTest() override {}
- void SetUp() override {
- if (GetParam())
- arc::SetArcAlwaysStartForTesting(true);
- MultiProfileMultiBrowserShelfLayoutChromeLauncherControllerTest::SetUp();
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerMultiProfileWithArcTest);
};
-INSTANTIATE_TEST_CASE_P(,
- ChromeLauncherControllerMultiProfileWithArcTest,
- ::testing::Bool());
-
TEST_F(ChromeLauncherControllerTest, DefaultApps) {
InitLauncherController();
// The model should only contain the browser shortcut, app list and back
@@ -1378,7 +1359,7 @@
EXPECT_FALSE(launcher_controller_->IsAppPinned(extension2_->id()));
}
-TEST_P(ChromeLauncherControllerWithArcTest, ArcAppPinCrossPlatformWorkflow) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcAppPinCrossPlatformWorkflow) {
// Work on ARC disabled platform first.
const std::string arc_app_id1 =
ArcAppTest::GetAppId(arc_test_.fake_apps()[0]);
@@ -1455,9 +1436,6 @@
EXPECT_EQ(0U, app_service_->sync_items().size());
// Move back to ARC disabled platform.
- // TODO(victorhsieh): Implement opt-out.
- if (arc::ShouldArcAlwaysStart())
- return;
EnablePlayStore(false);
StartAppSyncService(copy_sync_list);
RecreateLauncherController()->Init();
@@ -1931,7 +1909,7 @@
EXPECT_EQ("Back, AppList, Chrome", GetPinnedAppStatus());
}
-TEST_P(ChromeLauncherControllerWithArcTest, ArcDeferredLaunch) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcDeferredLaunch) {
InitLauncherController();
const arc::mojom::AppInfo& app1 = arc_test_.fake_apps()[0];
@@ -2013,7 +1991,7 @@
}
// Launch is canceled in case app becomes suspended.
-TEST_P(ChromeLauncherControllerWithArcTest, ArcDeferredLaunchForSuspendedApp) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcDeferredLaunchForSuspendedApp) {
InitLauncherController();
arc::mojom::AppInfo app = arc_test_.fake_apps()[0];
@@ -2047,7 +2025,7 @@
// Ensure the spinner controller does not override the active app controller
// (crbug.com/701152).
-TEST_P(ChromeLauncherControllerWithArcTest, ArcDeferredLaunchForActiveApp) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcDeferredLaunchForActiveApp) {
InitLauncherController();
SendListOfArcApps();
arc_test_.StopArcInstance();
@@ -2090,7 +2068,7 @@
launcher_controller_->GetShelfSpinnerController()->HasApp(app_id));
}
-TEST_P(ChromeLauncherControllerMultiProfileWithArcTest, ArcMultiUser) {
+TEST_F(ChromeLauncherControllerMultiProfileWithArcTest, ArcMultiUser) {
SendListOfArcApps();
InitLauncherController();
@@ -2155,7 +2133,7 @@
arc_window3->CloseNow();
}
-TEST_P(ChromeLauncherControllerWithArcTest, ArcRunningApp) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcRunningApp) {
InitLauncherController();
const std::string arc_app_id = ArcAppTest::GetAppId(arc_test_.fake_apps()[0]);
@@ -2191,7 +2169,7 @@
// Test race creation/deletion of ARC app.
// TODO(khmel): Remove after moving everything to wayland protocol.
-TEST_P(ChromeLauncherControllerWithArcTest, ArcRaceCreateClose) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcRaceCreateClose) {
InitLauncherController();
const std::string arc_app_id1 =
@@ -2230,7 +2208,7 @@
EXPECT_FALSE(launcher_controller_->GetItem(ash::ShelfID(arc_app_id2)));
}
-TEST_P(ChromeLauncherControllerWithArcTest, ArcWindowRecreation) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcWindowRecreation) {
InitLauncherController();
const std::string arc_app_id = ArcAppTest::GetAppId(arc_test_.fake_apps()[0]);
@@ -2260,7 +2238,7 @@
// but in case of ARC boot failure this may lead to such situation. This test
// verifies that dynamic change of app launcher controllers is safe.
// See more crbug.com/770005.
-TEST_P(ChromeLauncherControllerWithArcTest, OverrideAppItemController) {
+TEST_F(ChromeLauncherControllerWithArcTest, OverrideAppItemController) {
extension_service_->AddExtension(arc_support_host_.get());
InitLauncherController();
@@ -2361,7 +2339,7 @@
// Validate that ARC app is pinned correctly and pin is removed automatically
// once app is uninstalled.
-TEST_P(ChromeLauncherControllerWithArcTest, ArcAppPin) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcAppPin) {
InitLauncherController();
const std::string arc_app_id = ArcAppTest::GetAppId(arc_test_.fake_apps()[0]);
@@ -2384,10 +2362,7 @@
EXPECT_EQ("Back, AppList, Chrome, App1, Fake App 0, App2",
GetPinnedAppStatus());
- // In opt-out mode, only system apps are available and can't be uninstalled.
- // Skip the rest of the test.
- if (arc::ShouldArcAlwaysStart())
- return;
+
UninstallArcApps();
EXPECT_FALSE(launcher_controller_->IsAppPinned(arc_app_id));
EXPECT_EQ("Back, AppList, Chrome, App1, App2", GetPinnedAppStatus());
@@ -2409,7 +2384,7 @@
}
// Validates that ARC app pins persist across OptOut/OptIn.
-TEST_P(ChromeLauncherControllerWithArcTest, ArcAppPinOptOutOptIn) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcAppPinOptOutOptIn) {
InitLauncherController();
const std::string arc_app_id1 =
@@ -2433,9 +2408,6 @@
EXPECT_EQ("Back, AppList, Chrome, App1, Fake App 1, App2, Fake App 0",
GetPinnedAppStatus());
- // TODO(victorhsieh): Implement opt-out.
- if (arc::ShouldArcAlwaysStart())
- return;
EnablePlayStore(false);
EXPECT_EQ("Back, AppList, Chrome, App1, App2", GetPinnedAppStatus());
@@ -2457,7 +2429,7 @@
GetPinnedAppStatus());
}
-TEST_P(ChromeLauncherControllerWithArcTest, ArcCustomAppIcon) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcCustomAppIcon) {
InitLauncherController();
TestShelfController* shelf_controller =
@@ -2551,7 +2523,7 @@
shelf_controller->GetLastItemImage()));
}
-TEST_P(ChromeLauncherControllerWithArcTest, ArcWindowPackageName) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcWindowPackageName) {
InitLauncherController();
SendListOfArcApps();
@@ -3945,7 +3917,7 @@
EXPECT_EQ(1, app_icon_loader2->clear_count());
}
-TEST_P(ChromeLauncherControllerWithArcTest, ArcAppPinPolicy) {
+TEST_F(ChromeLauncherControllerWithArcTest, ArcAppPinPolicy) {
InitLauncherControllerWithBrowser();
arc::mojom::AppInfo appinfo =
CreateAppInfo("Some App", "SomeActivity", "com.example.app");
@@ -3964,11 +3936,7 @@
GetPinnableForAppID(app_id, profile()));
}
-TEST_P(ChromeLauncherControllerWithArcTest, ArcManaged) {
- // TODO(victorhsieh): Implement opt-in and opt-out.
- if (arc::ShouldArcAlwaysStart())
- return;
-
+TEST_F(ChromeLauncherControllerWithArcTest, ArcManaged) {
extension_service_->AddExtension(arc_support_host_.get());
// Test enables ARC, so turn it off for initial values.
EnablePlayStore(false);
@@ -4027,7 +3995,7 @@
}
// Test the application menu of a shelf item with multiple ARC windows.
-TEST_P(ChromeLauncherControllerWithArcTest, ShelfItemWithMultipleWindows) {
+TEST_F(ChromeLauncherControllerWithArcTest, ShelfItemWithMultipleWindows) {
InitLauncherControllerWithBrowser();
arc::mojom::AppInfo appinfo =
@@ -4086,16 +4054,13 @@
namespace {
class ChromeLauncherControllerArcDefaultAppsTest
- : public ChromeLauncherControllerTest,
- public ::testing::WithParamInterface<bool> {
+ : public ChromeLauncherControllerTest {
public:
ChromeLauncherControllerArcDefaultAppsTest() {}
~ChromeLauncherControllerArcDefaultAppsTest() override {}
protected:
void SetUp() override {
- if (GetParam())
- arc::SetArcAlwaysStartForTesting(true);
ArcAppIcon::DisableSafeDecodingForTesting();
ArcDefaultAppList::UseTestAppsDirectory();
ChromeLauncherControllerTest::SetUp();
@@ -4105,10 +4070,6 @@
DISALLOW_COPY_AND_ASSIGN(ChromeLauncherControllerArcDefaultAppsTest);
};
-INSTANTIATE_TEST_CASE_P(,
- ChromeLauncherControllerArcDefaultAppsTest,
- ::testing::Bool());
-
class ChromeLauncherControllerPlayStoreAvailabilityTest
: public ChromeLauncherControllerTest,
public ::testing::WithParamInterface<bool> {
@@ -4119,7 +4080,7 @@
protected:
void SetUp() override {
if (GetParam())
- arc::SetArcAlwaysStartForTesting(false);
+ arc::SetArcAlwaysStartWithoutPlayStoreForTesting();
ArcDefaultAppList::UseTestAppsDirectory();
ChromeLauncherControllerTest::SetUp();
}
@@ -4134,7 +4095,7 @@
} // namespace
-TEST_P(ChromeLauncherControllerArcDefaultAppsTest, DefaultApps) {
+TEST_F(ChromeLauncherControllerArcDefaultAppsTest, DefaultApps) {
arc_test_.SetUp(profile());
InitLauncherController();
@@ -4205,7 +4166,7 @@
shelf_controller->updated_count());
}
-TEST_P(ChromeLauncherControllerArcDefaultAppsTest, PlayStoreDeferredLaunch) {
+TEST_F(ChromeLauncherControllerArcDefaultAppsTest, PlayStoreDeferredLaunch) {
// Add ARC host app to enable Play Store default app.
extension_service_->AddExtension(arc_support_host_.get());
arc_test_.SetUp(profile());
@@ -4542,8 +4503,6 @@
~ChromeLauncherControllerDemoModeTest() override {}
void SetUp() override {
- arc::SetArcAlwaysStartForTesting(true);
-
// To prevent crash on test exit and pending decode request.
ArcAppIcon::DisableSafeDecodingForTesting();
diff --git a/components/arc/arc_util.cc b/components/arc/arc_util.cc
index 7ca23ee..5f24855 100644
--- a/components/arc/arc_util.cc
+++ b/components/arc/arc_util.cc
@@ -31,7 +31,6 @@
constexpr char kAvailabilityNone[] = "none";
constexpr char kAvailabilityInstalled[] = "installed";
constexpr char kAvailabilityOfficiallySupported[] = "officially-supported";
-constexpr char kAlwaysStart[] = "always-start";
constexpr char kAlwaysStartWithNoPlayStore[] =
"always-start-with-no-play-store";
@@ -75,9 +74,8 @@
const auto* command_line = base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(chromeos::switches::kArcStartMode))
return false;
- const std::string value =
- command_line->GetSwitchValueASCII(chromeos::switches::kArcStartMode);
- return value == kAlwaysStartWithNoPlayStore || value == kAlwaysStart;
+ return command_line->GetSwitchValueASCII(chromeos::switches::kArcStartMode) ==
+ kAlwaysStartWithNoPlayStore;
}
bool ShouldArcAlwaysStartWithNoPlayStore() {
@@ -90,10 +88,9 @@
chromeos::switches::kArcForceShowOptInUi);
}
-void SetArcAlwaysStartForTesting(bool play_store_available) {
+void SetArcAlwaysStartWithoutPlayStoreForTesting() {
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- chromeos::switches::kArcStartMode,
- play_store_available ? kAlwaysStart : kAlwaysStartWithNoPlayStore);
+ chromeos::switches::kArcStartMode, kAlwaysStartWithNoPlayStore);
}
bool IsArcKioskAvailable() {
diff --git a/components/arc/arc_util.h b/components/arc/arc_util.h
index 993d5e67..7d6ec124 100644
--- a/components/arc/arc_util.h
+++ b/components/arc/arc_util.h
@@ -49,10 +49,9 @@
// Returns true if ARC OptIn ui needs to be shown for testing.
bool ShouldShowOptInForTesting();
-// Enables to always start ARC for testing, by appending the command line flag.
-// If |bool play_store_available| is not set then flag that disables ARC Play
-// Store UI is added.
-void SetArcAlwaysStartForTesting(bool play_store_available);
+// Enables to always start ARC without Play Store for testing, by appending the
+// command line flag.
+void SetArcAlwaysStartWithoutPlayStoreForTesting();
// Returns true if ARC is installed and running ARC kiosk apps on the current
// device is officially supported.
diff --git a/components/arc/arc_util_unittest.cc b/components/arc/arc_util_unittest.cc
index 0bc9e2a0..bf81c4ef 100644
--- a/components/arc/arc_util_unittest.cc
+++ b/components/arc/arc_util_unittest.cc
@@ -242,14 +242,6 @@
EXPECT_FALSE(ShouldArcAlwaysStartWithNoPlayStore());
}
-TEST_F(ArcUtilTest, ArcStartModeAlwaysStart) {
- auto* command_line = base::CommandLine::ForCurrentProcess();
- command_line->InitFromArgv(
- {"", "--arc-availability=installed", "--arc-start-mode=always-start"});
- EXPECT_TRUE(ShouldArcAlwaysStart());
- EXPECT_FALSE(ShouldArcAlwaysStartWithNoPlayStore());
-}
-
TEST_F(ArcUtilTest, ArcStartModeWithoutPlayStore) {
auto* command_line = base::CommandLine::ForCurrentProcess();
command_line->InitFromArgv(