Index: chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc |
diff --git a/chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc b/chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc |
index 10f5f075c70cecfd6c6895aae266beb81cb325aa..e68a27c6aad76add3b3e06def8cad04e76b067d1 100644 |
--- a/chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc |
+++ b/chrome/browser/signin/easy_unlock_service_browsertest_chromeos.cc |
@@ -22,6 +22,7 @@ |
#include "components/policy/core/common/mock_configuration_policy_provider.h" |
#include "components/policy/core/common/policy_map.h" |
#include "components/policy/core/common/policy_types.h" |
+#include "components/proximity_auth/switches.h" |
#include "components/user_manager/user_manager.h" |
#include "content/public/common/content_switches.h" |
#include "device/bluetooth/bluetooth_adapter_factory.h" |
@@ -136,51 +137,7 @@ class EasyUnlockServiceTest : public InProcessBrowserTest { |
DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceTest); |
}; |
-IN_PROC_BROWSER_TEST_F(EasyUnlockServiceTest, NoFinchNoService) { |
- EXPECT_FALSE(service()->IsAllowed()); |
-#if defined(GOOGLE_CHROME_BUILD) |
- EXPECT_FALSE(HasEasyUnlockApp()); |
-#endif |
-} |
- |
-class EasyUnlockServiceNoBluetoothTest : public EasyUnlockServiceTest { |
- public: |
- EasyUnlockServiceNoBluetoothTest() {} |
- virtual ~EasyUnlockServiceNoBluetoothTest() {} |
- |
- // InProcessBrowserTest: |
- virtual void SetUpInProcessBrowserTestFixture() override { |
- set_is_bluetooth_adapter_present(false); |
- EasyUnlockServiceTest::SetUpInProcessBrowserTestFixture(); |
- } |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceNoBluetoothTest); |
-}; |
- |
-IN_PROC_BROWSER_TEST_F(EasyUnlockServiceNoBluetoothTest, NoService) { |
- EXPECT_FALSE(service()->IsAllowed()); |
-#if defined(GOOGLE_CHROME_BUILD) |
- EXPECT_FALSE(HasEasyUnlockApp()); |
-#endif |
-} |
- |
-class EasyUnlockServiceFinchEnabledTest : public EasyUnlockServiceTest { |
- public: |
- EasyUnlockServiceFinchEnabledTest() {} |
- virtual ~EasyUnlockServiceFinchEnabledTest() {} |
- |
- // InProcessBrowserTest: |
- virtual void SetUpCommandLine(CommandLine* command_line) override { |
- command_line->AppendSwitchASCII(switches::kForceFieldTrials, |
- "EasyUnlock/Enable/"); |
- } |
- |
- private: |
- DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceFinchEnabledTest); |
-}; |
- |
-IN_PROC_BROWSER_TEST_F(EasyUnlockServiceFinchEnabledTest, Enabled) { |
+IN_PROC_BROWSER_TEST_F(EasyUnlockServiceTest, DefaultOn) { |
EXPECT_TRUE(service()->IsAllowed()); |
#if defined(GOOGLE_CHROME_BUILD) |
EXPECT_TRUE(HasEasyUnlockApp()); |
@@ -188,7 +145,7 @@ IN_PROC_BROWSER_TEST_F(EasyUnlockServiceFinchEnabledTest, Enabled) { |
} |
#if defined(GOOGLE_CHROME_BUILD) |
-IN_PROC_BROWSER_TEST_F(EasyUnlockServiceFinchEnabledTest, UnloadsOnSuspend) { |
+IN_PROC_BROWSER_TEST_F(EasyUnlockServiceTest, UnloadsOnSuspend) { |
EXPECT_TRUE(HasEasyUnlockApp()); |
power_manager_client()->SendSuspendImminent(); |
EXPECT_FALSE(HasEasyUnlockApp()); |
@@ -197,8 +154,7 @@ IN_PROC_BROWSER_TEST_F(EasyUnlockServiceFinchEnabledTest, UnloadsOnSuspend) { |
} |
#endif |
-// Tests that policy can override finch to turn easy unlock off. |
-IN_PROC_BROWSER_TEST_F(EasyUnlockServiceFinchEnabledTest, PolicyOveride) { |
+IN_PROC_BROWSER_TEST_F(EasyUnlockServiceTest, PolicyOveride) { |
EXPECT_TRUE(service()->IsAllowed()); |
#if defined(GOOGLE_CHROME_BUILD) |
EXPECT_TRUE(HasEasyUnlockApp()); |
@@ -218,25 +174,51 @@ IN_PROC_BROWSER_TEST_F(EasyUnlockServiceFinchEnabledTest, PolicyOveride) { |
#endif |
} |
-class EasyUnlockServiceFinchDisabledTest : public EasyUnlockServiceTest { |
+class EasyUnlockServiceNoBluetoothTest : public EasyUnlockServiceTest { |
+ public: |
+ EasyUnlockServiceNoBluetoothTest() {} |
+ virtual ~EasyUnlockServiceNoBluetoothTest() {} |
+ |
+ // InProcessBrowserTest: |
+ virtual void SetUpInProcessBrowserTestFixture() override { |
+ set_is_bluetooth_adapter_present(false); |
+ EasyUnlockServiceTest::SetUpInProcessBrowserTestFixture(); |
+ } |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceNoBluetoothTest); |
+}; |
+ |
+IN_PROC_BROWSER_TEST_F(EasyUnlockServiceNoBluetoothTest, NoService) { |
+ EXPECT_FALSE(service()->IsAllowed()); |
+#if defined(GOOGLE_CHROME_BUILD) |
+ EXPECT_FALSE(HasEasyUnlockApp()); |
+#endif |
+} |
+ |
+class EasyUnlockServiceDisabledTest : public EasyUnlockServiceTest { |
public: |
- EasyUnlockServiceFinchDisabledTest() {} |
- virtual ~EasyUnlockServiceFinchDisabledTest() {} |
+ EasyUnlockServiceDisabledTest() {} |
+ virtual ~EasyUnlockServiceDisabledTest() {} |
// InProcessBrowserTest: |
virtual void SetUpCommandLine(CommandLine* command_line) override { |
- command_line->AppendSwitchASCII(switches::kForceFieldTrials, |
- "EasyUnlock/Disable/"); |
+ command_line->AppendSwitch(proximity_auth::switches::kDisableEasyUnlock); |
} |
private: |
- DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceFinchDisabledTest); |
+ DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceDisabledTest); |
}; |
-// Tests that easy unlock is off when finch is disabled and policy overrides |
-// finch. |
-IN_PROC_BROWSER_TEST_F(EasyUnlockServiceFinchDisabledTest, PolicyOverride) { |
- // Finch is disabled. |
+IN_PROC_BROWSER_TEST_F(EasyUnlockServiceDisabledTest, Disabled) { |
+ EXPECT_FALSE(service()->IsAllowed()); |
+#if defined(GOOGLE_CHROME_BUILD) |
+ EXPECT_FALSE(HasEasyUnlockApp()); |
+#endif |
+} |
+ |
+// Tests that policy does not override disabled switch. |
+IN_PROC_BROWSER_TEST_F(EasyUnlockServiceDisabledTest, NoPolicyOverride) { |
EXPECT_FALSE(service()->IsAllowed()); |
#if defined(GOOGLE_CHROME_BUILD) |
EXPECT_FALSE(HasEasyUnlockApp()); |
@@ -244,9 +226,9 @@ IN_PROC_BROWSER_TEST_F(EasyUnlockServiceFinchDisabledTest, PolicyOverride) { |
// Policy overrides finch and turns on Easy unlock. |
SetEasyUnlockAllowedPolicy(true); |
- EXPECT_TRUE(service()->IsAllowed()); |
+ EXPECT_FALSE(service()->IsAllowed()); |
#if defined(GOOGLE_CHROME_BUILD) |
- EXPECT_TRUE(HasEasyUnlockApp()); |
+ EXPECT_FALSE(HasEasyUnlockApp()); |
#endif |
} |