OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 2928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2939 EXPECT_FALSE(accessibility_manager->IsLargeCursorEnabled()); | 2939 EXPECT_FALSE(accessibility_manager->IsLargeCursorEnabled()); |
2940 } | 2940 } |
2941 | 2941 |
2942 IN_PROC_BROWSER_TEST_F(PolicyTest, SpokenFeedbackEnabled) { | 2942 IN_PROC_BROWSER_TEST_F(PolicyTest, SpokenFeedbackEnabled) { |
2943 // Verifies that the spoken feedback accessibility feature can be controlled | 2943 // Verifies that the spoken feedback accessibility feature can be controlled |
2944 // through policy. | 2944 // through policy. |
2945 chromeos::AccessibilityManager* accessibility_manager = | 2945 chromeos::AccessibilityManager* accessibility_manager = |
2946 chromeos::AccessibilityManager::Get(); | 2946 chromeos::AccessibilityManager::Get(); |
2947 | 2947 |
2948 // Manually enable spoken feedback. | 2948 // Manually enable spoken feedback. |
2949 accessibility_manager->EnableSpokenFeedback( | 2949 accessibility_manager->EnableSpokenFeedback(true, |
2950 true, ui::A11Y_NOTIFICATION_NONE); | 2950 ash::A11Y_NOTIFICATION_NONE); |
2951 EXPECT_TRUE(accessibility_manager->IsSpokenFeedbackEnabled()); | 2951 EXPECT_TRUE(accessibility_manager->IsSpokenFeedbackEnabled()); |
2952 | 2952 |
2953 // Verify that policy overrides the manual setting. | 2953 // Verify that policy overrides the manual setting. |
2954 PolicyMap policies; | 2954 PolicyMap policies; |
2955 policies.Set(key::kSpokenFeedbackEnabled, POLICY_LEVEL_MANDATORY, | 2955 policies.Set(key::kSpokenFeedbackEnabled, POLICY_LEVEL_MANDATORY, |
2956 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 2956 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
2957 base::WrapUnique(new base::FundamentalValue(false)), nullptr); | 2957 base::WrapUnique(new base::FundamentalValue(false)), nullptr); |
2958 UpdateProviderPolicy(policies); | 2958 UpdateProviderPolicy(policies); |
2959 EXPECT_FALSE(accessibility_manager->IsSpokenFeedbackEnabled()); | 2959 EXPECT_FALSE(accessibility_manager->IsSpokenFeedbackEnabled()); |
2960 | 2960 |
2961 // Verify that spoken feedback cannot be enabled manually anymore. | 2961 // Verify that spoken feedback cannot be enabled manually anymore. |
2962 accessibility_manager->EnableSpokenFeedback( | 2962 accessibility_manager->EnableSpokenFeedback(true, |
2963 true, ui::A11Y_NOTIFICATION_NONE); | 2963 ash::A11Y_NOTIFICATION_NONE); |
2964 EXPECT_FALSE(accessibility_manager->IsSpokenFeedbackEnabled()); | 2964 EXPECT_FALSE(accessibility_manager->IsSpokenFeedbackEnabled()); |
2965 } | 2965 } |
2966 | 2966 |
2967 IN_PROC_BROWSER_TEST_F(PolicyTest, HighContrastEnabled) { | 2967 IN_PROC_BROWSER_TEST_F(PolicyTest, HighContrastEnabled) { |
2968 // Verifies that the high contrast mode accessibility feature can be | 2968 // Verifies that the high contrast mode accessibility feature can be |
2969 // controlled through policy. | 2969 // controlled through policy. |
2970 chromeos::AccessibilityManager* accessibility_manager = | 2970 chromeos::AccessibilityManager* accessibility_manager = |
2971 chromeos::AccessibilityManager::Get(); | 2971 chromeos::AccessibilityManager::Get(); |
2972 | 2972 |
2973 // Manually enable high contrast mode. | 2973 // Manually enable high contrast mode. |
(...skipping 12 matching lines...) Expand all Loading... |
2986 accessibility_manager->EnableHighContrast(true); | 2986 accessibility_manager->EnableHighContrast(true); |
2987 EXPECT_FALSE(accessibility_manager->IsHighContrastEnabled()); | 2987 EXPECT_FALSE(accessibility_manager->IsHighContrastEnabled()); |
2988 } | 2988 } |
2989 | 2989 |
2990 IN_PROC_BROWSER_TEST_F(PolicyTest, ScreenMagnifierTypeNone) { | 2990 IN_PROC_BROWSER_TEST_F(PolicyTest, ScreenMagnifierTypeNone) { |
2991 // Verifies that the screen magnifier can be disabled through policy. | 2991 // Verifies that the screen magnifier can be disabled through policy. |
2992 chromeos::MagnificationManager* magnification_manager = | 2992 chromeos::MagnificationManager* magnification_manager = |
2993 chromeos::MagnificationManager::Get(); | 2993 chromeos::MagnificationManager::Get(); |
2994 | 2994 |
2995 // Manually enable the full-screen magnifier. | 2995 // Manually enable the full-screen magnifier. |
2996 magnification_manager->SetMagnifierType(ui::MAGNIFIER_FULL); | 2996 magnification_manager->SetMagnifierType(ash::MAGNIFIER_FULL); |
2997 magnification_manager->SetMagnifierEnabled(true); | 2997 magnification_manager->SetMagnifierEnabled(true); |
2998 EXPECT_EQ(ui::MAGNIFIER_FULL, magnification_manager->GetMagnifierType()); | 2998 EXPECT_EQ(ash::MAGNIFIER_FULL, magnification_manager->GetMagnifierType()); |
2999 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); | 2999 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); |
3000 | 3000 |
3001 // Verify that policy overrides the manual setting. | 3001 // Verify that policy overrides the manual setting. |
3002 PolicyMap policies; | 3002 PolicyMap policies; |
3003 policies.Set(key::kScreenMagnifierType, POLICY_LEVEL_MANDATORY, | 3003 policies.Set(key::kScreenMagnifierType, POLICY_LEVEL_MANDATORY, |
3004 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 3004 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, |
3005 base::WrapUnique(new base::FundamentalValue(0)), nullptr); | 3005 base::WrapUnique(new base::FundamentalValue(0)), nullptr); |
3006 UpdateProviderPolicy(policies); | 3006 UpdateProviderPolicy(policies); |
3007 EXPECT_FALSE(magnification_manager->IsMagnifierEnabled()); | 3007 EXPECT_FALSE(magnification_manager->IsMagnifierEnabled()); |
3008 | 3008 |
3009 // Verify that the screen magnifier cannot be enabled manually anymore. | 3009 // Verify that the screen magnifier cannot be enabled manually anymore. |
3010 magnification_manager->SetMagnifierEnabled(true); | 3010 magnification_manager->SetMagnifierEnabled(true); |
3011 EXPECT_FALSE(magnification_manager->IsMagnifierEnabled()); | 3011 EXPECT_FALSE(magnification_manager->IsMagnifierEnabled()); |
3012 } | 3012 } |
3013 | 3013 |
3014 IN_PROC_BROWSER_TEST_F(PolicyTest, ScreenMagnifierTypeFull) { | 3014 IN_PROC_BROWSER_TEST_F(PolicyTest, ScreenMagnifierTypeFull) { |
3015 // Verifies that the full-screen magnifier can be enabled through policy. | 3015 // Verifies that the full-screen magnifier can be enabled through policy. |
3016 chromeos::MagnificationManager* magnification_manager = | 3016 chromeos::MagnificationManager* magnification_manager = |
3017 chromeos::MagnificationManager::Get(); | 3017 chromeos::MagnificationManager::Get(); |
3018 | 3018 |
3019 // Verify that the screen magnifier is initially disabled. | 3019 // Verify that the screen magnifier is initially disabled. |
3020 EXPECT_FALSE(magnification_manager->IsMagnifierEnabled()); | 3020 EXPECT_FALSE(magnification_manager->IsMagnifierEnabled()); |
3021 | 3021 |
3022 // Verify that policy can enable the full-screen magnifier. | 3022 // Verify that policy can enable the full-screen magnifier. |
3023 PolicyMap policies; | 3023 PolicyMap policies; |
3024 policies.Set(key::kScreenMagnifierType, POLICY_LEVEL_MANDATORY, | 3024 policies.Set( |
3025 POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD, | 3025 key::kScreenMagnifierType, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
3026 base::WrapUnique(new base::FundamentalValue(ui::MAGNIFIER_FULL)), | 3026 POLICY_SOURCE_CLOUD, |
3027 nullptr); | 3027 base::WrapUnique(new base::FundamentalValue(ash::MAGNIFIER_FULL)), |
| 3028 nullptr); |
3028 UpdateProviderPolicy(policies); | 3029 UpdateProviderPolicy(policies); |
3029 EXPECT_EQ(ui::MAGNIFIER_FULL, magnification_manager->GetMagnifierType()); | 3030 EXPECT_EQ(ash::MAGNIFIER_FULL, magnification_manager->GetMagnifierType()); |
3030 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); | 3031 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); |
3031 | 3032 |
3032 // Verify that the screen magnifier cannot be disabled manually anymore. | 3033 // Verify that the screen magnifier cannot be disabled manually anymore. |
3033 magnification_manager->SetMagnifierEnabled(false); | 3034 magnification_manager->SetMagnifierEnabled(false); |
3034 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); | 3035 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); |
3035 } | 3036 } |
3036 | 3037 |
3037 IN_PROC_BROWSER_TEST_F(PolicyTest, AccessibilityVirtualKeyboardEnabled) { | 3038 IN_PROC_BROWSER_TEST_F(PolicyTest, AccessibilityVirtualKeyboardEnabled) { |
3038 // Verifies that the on-screen keyboard accessibility feature can be | 3039 // Verifies that the on-screen keyboard accessibility feature can be |
3039 // controlled through policy. | 3040 // controlled through policy. |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4096 | 4097 |
4097 SetEmptyPolicy(); | 4098 SetEmptyPolicy(); |
4098 // Policy not set. | 4099 // Policy not set. |
4099 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4100 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
4100 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4101 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
4101 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4102 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
4102 } | 4103 } |
4103 #endif // defined(OS_CHROMEOS) | 4104 #endif // defined(OS_CHROMEOS) |
4104 | 4105 |
4105 } // namespace policy | 4106 } // namespace policy |
OLD | NEW |