| Index: chrome/browser/chromeos/extensions/info_private_apitest.cc
|
| diff --git a/chrome/browser/chromeos/extensions/info_private_apitest.cc b/chrome/browser/chromeos/extensions/info_private_apitest.cc
|
| index 7f7e35e84a91472abb44410d53deed7f3ae829dc..a41c4c39be48950f3b70266f27c4c64a63260030 100644
|
| --- a/chrome/browser/chromeos/extensions/info_private_apitest.cc
|
| +++ b/chrome/browser/chromeos/extensions/info_private_apitest.cc
|
| @@ -3,12 +3,13 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/values.h"
|
| +#include "chrome/browser/chromeos/arc/arc_session_manager.h"
|
| #include "chrome/browser/chromeos/settings/cros_settings.h"
|
| #include "chrome/browser/extensions/extension_apitest.h"
|
| #include "chrome/common/chrome_switches.h"
|
| #include "chrome/common/pref_names.h"
|
| -#include "chromeos/chromeos_switches.h"
|
| #include "chromeos/settings/cros_settings_names.h"
|
| +#include "components/arc/arc_util.h"
|
| #include "components/prefs/pref_service.h"
|
|
|
| namespace {
|
| @@ -29,16 +30,6 @@ class ChromeOSInfoPrivateTest : public ExtensionApiTest {
|
| base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(switches::kAppId,
|
| kTestAppId);
|
| }
|
| -
|
| - void MakeArcAvailable() {
|
| - base::CommandLine::ForCurrentProcess()->AppendSwitch(
|
| - chromeos::switches::kArcAvailable);
|
| - }
|
| -
|
| - void EnableArc() {
|
| - base::CommandLine::ForCurrentProcess()->AppendSwitch(
|
| - chromeos::switches::kEnableArc);
|
| - }
|
| };
|
|
|
| IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, TestGetAndSet) {
|
| @@ -83,16 +74,41 @@ IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, Kiosk) {
|
| << message_;
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, ArcAvailable) {
|
| - MakeArcAvailable();
|
| +IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, ArcNotAvailable) {
|
| ASSERT_TRUE(RunPlatformAppTestWithArg("chromeos_info_private/extended",
|
| - "arc available"))
|
| + "arc not-available"))
|
| << message_;
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_F(ChromeOSInfoPrivateTest, ArcEnabled) {
|
| - EnableArc();
|
| +class ChromeOSArcInfoPrivateTest : public ChromeOSInfoPrivateTest {
|
| + public:
|
| + ChromeOSArcInfoPrivateTest() = default;
|
| + ~ChromeOSArcInfoPrivateTest() override = default;
|
| +
|
| + void SetUpCommandLine(base::CommandLine* command_line) override {
|
| + ExtensionApiTest::SetUpCommandLine(command_line);
|
| + // Make ARC enabled for ArcAvailable/ArcEnabled tests.
|
| + arc::SetArcAvailableCommandLineForTesting(command_line);
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(ChromeOSArcInfoPrivateTest);
|
| +};
|
| +
|
| +IN_PROC_BROWSER_TEST_F(ChromeOSArcInfoPrivateTest, ArcEnabled) {
|
| ASSERT_TRUE(RunPlatformAppTestWithArg("chromeos_info_private/extended",
|
| "arc enabled"))
|
| << message_;
|
| }
|
| +
|
| +IN_PROC_BROWSER_TEST_F(ChromeOSArcInfoPrivateTest, ArcAvailable) {
|
| + // Even if ARC is available, ARC may not be able to be enabled. (Please
|
| + // see ArcSessionManager::IsAllowedForProfile() for details).
|
| + // In such cases, we expect "available". However, current testing framework
|
| + // does not seem to run with such cases, unfortunately. So, here directly
|
| + // control the function.
|
| + arc::ArcSessionManager::DisallowForTesting();
|
| + ASSERT_TRUE(RunPlatformAppTestWithArg("chromeos_info_private/extended",
|
| + "arc available"))
|
| + << message_;
|
| +}
|
|
|