| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "ash/magnifier/magnifier_constants.h" | 7 #include "ash/magnifier/magnifier_constants.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 base::FundamentalValue(true)); | 255 base::FundamentalValue(true)); |
| 256 | 256 |
| 257 // Verify that the large cursor is enabled. | 257 // Verify that the large cursor is enabled. |
| 258 chromeos::AccessibilityManager* accessibility_manager = | 258 chromeos::AccessibilityManager* accessibility_manager = |
| 259 chromeos::AccessibilityManager::Get(); | 259 chromeos::AccessibilityManager::Get(); |
| 260 ASSERT_TRUE(accessibility_manager); | 260 ASSERT_TRUE(accessibility_manager); |
| 261 EXPECT_TRUE(accessibility_manager->IsLargeCursorEnabled()); | 261 EXPECT_TRUE(accessibility_manager->IsLargeCursorEnabled()); |
| 262 } | 262 } |
| 263 | 263 |
| 264 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest, | 264 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest, |
| 265 DeviceLoginScreenDefaultSpokenFeedbackEnabled) { | |
| 266 // Verifies that the default state of the spoken feedback accessibility | |
| 267 // feature on the login screen can be controlled through device policy. | |
| 268 | |
| 269 // Enable spoken feedback through device policy and wait for the change to | |
| 270 // take effect. | |
| 271 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); | |
| 272 proto.mutable_accessibility_settings()-> | |
| 273 set_login_screen_default_spoken_feedback_enabled(true); | |
| 274 RefreshDevicePolicyAndWaitForPrefChange(prefs::kSpokenFeedbackEnabled); | |
| 275 | |
| 276 // Verify that the pref which controls spoken feedback in the login profile | |
| 277 // has changed to the policy-supplied default. | |
| 278 VerifyPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled, | |
| 279 base::FundamentalValue(true)); | |
| 280 | |
| 281 // Verify that spoken feedback is enabled. | |
| 282 chromeos::AccessibilityManager* accessibility_manager = | |
| 283 chromeos::AccessibilityManager::Get(); | |
| 284 ASSERT_TRUE(accessibility_manager); | |
| 285 EXPECT_TRUE(accessibility_manager->IsSpokenFeedbackEnabled()); | |
| 286 } | |
| 287 | |
| 288 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest, | |
| 289 DeviceLoginScreenDefaultHighContrastEnabled) { | 265 DeviceLoginScreenDefaultHighContrastEnabled) { |
| 290 // Verifies that the default state of the high contrast mode accessibility | 266 // Verifies that the default state of the high contrast mode accessibility |
| 291 // feature on the login screen can be controlled through device policy. | 267 // feature on the login screen can be controlled through device policy. |
| 292 | 268 |
| 293 // Enable high contrast mode through device policy and wait for the change to | 269 // Enable high contrast mode through device policy and wait for the change to |
| 294 // take effect. | 270 // take effect. |
| 295 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); | 271 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); |
| 296 proto.mutable_accessibility_settings()-> | 272 proto.mutable_accessibility_settings()-> |
| 297 set_login_screen_default_high_contrast_enabled(true); | 273 set_login_screen_default_high_contrast_enabled(true); |
| 298 RefreshDevicePolicyAndWaitForPrefChange(prefs::kHighContrastEnabled); | 274 RefreshDevicePolicyAndWaitForPrefChange(prefs::kHighContrastEnabled); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 VerifyPrefFollowsDefault(prefs::kLargeCursorEnabled); | 330 VerifyPrefFollowsDefault(prefs::kLargeCursorEnabled); |
| 355 | 331 |
| 356 // Verify that the large cursor is disabled. | 332 // Verify that the large cursor is disabled. |
| 357 chromeos::AccessibilityManager* accessibility_manager = | 333 chromeos::AccessibilityManager* accessibility_manager = |
| 358 chromeos::AccessibilityManager::Get(); | 334 chromeos::AccessibilityManager::Get(); |
| 359 ASSERT_TRUE(accessibility_manager); | 335 ASSERT_TRUE(accessibility_manager); |
| 360 EXPECT_FALSE(accessibility_manager->IsLargeCursorEnabled()); | 336 EXPECT_FALSE(accessibility_manager->IsLargeCursorEnabled()); |
| 361 } | 337 } |
| 362 | 338 |
| 363 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyInSessionBrowsertest, | 339 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyInSessionBrowsertest, |
| 364 DeviceLoginScreenDefaultSpokenFeedbackEnabled) { | |
| 365 // Verifies that changing the default state of the spoken feedback | |
| 366 // accessibility feature on the login screen through policy does not affect | |
| 367 // its state in a session. | |
| 368 | |
| 369 // Enable spoken feedback through device policy and wait for the change to | |
| 370 // take effect. | |
| 371 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); | |
| 372 proto.mutable_accessibility_settings()-> | |
| 373 set_login_screen_default_spoken_feedback_enabled(true); | |
| 374 RefreshDevicePolicyAndWaitForPrefChange(prefs::kSpokenFeedbackEnabled); | |
| 375 | |
| 376 // Verify that the pref which controls the spoken feedback in the session is | |
| 377 // unchanged. | |
| 378 VerifyPrefFollowsDefault(prefs::kSpokenFeedbackEnabled); | |
| 379 | |
| 380 // Verify that spoken feedback is disabled. | |
| 381 chromeos::AccessibilityManager* accessibility_manager = | |
| 382 chromeos::AccessibilityManager::Get(); | |
| 383 ASSERT_TRUE(accessibility_manager); | |
| 384 EXPECT_FALSE(accessibility_manager->IsSpokenFeedbackEnabled()); | |
| 385 } | |
| 386 | |
| 387 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyInSessionBrowsertest, | |
| 388 DeviceLoginScreenDefaultHighContrastEnabled) { | 340 DeviceLoginScreenDefaultHighContrastEnabled) { |
| 389 // Verifies that changing the default state of the high contrast mode | 341 // Verifies that changing the default state of the high contrast mode |
| 390 // accessibility feature on the login screen through policy does not affect | 342 // accessibility feature on the login screen through policy does not affect |
| 391 // its state in a session. | 343 // its state in a session. |
| 392 | 344 |
| 393 // Enable high contrast mode through device policy and wait for the change to | 345 // Enable high contrast mode through device policy and wait for the change to |
| 394 // take effect. | 346 // take effect. |
| 395 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); | 347 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); |
| 396 proto.mutable_accessibility_settings()-> | 348 proto.mutable_accessibility_settings()-> |
| 397 set_login_screen_default_high_contrast_enabled(true); | 349 set_login_screen_default_high_contrast_enabled(true); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 428 // Verify that the screen magnifier is disabled. | 380 // Verify that the screen magnifier is disabled. |
| 429 chromeos::MagnificationManager* magnification_manager = | 381 chromeos::MagnificationManager* magnification_manager = |
| 430 chromeos::MagnificationManager::Get(); | 382 chromeos::MagnificationManager::Get(); |
| 431 ASSERT_TRUE(magnification_manager); | 383 ASSERT_TRUE(magnification_manager); |
| 432 EXPECT_FALSE(magnification_manager->IsMagnifierEnabled()); | 384 EXPECT_FALSE(magnification_manager->IsMagnifierEnabled()); |
| 433 EXPECT_EQ(ash::kDefaultMagnifierType, | 385 EXPECT_EQ(ash::kDefaultMagnifierType, |
| 434 magnification_manager->GetMagnifierType()); | 386 magnification_manager->GetMagnifierType()); |
| 435 } | 387 } |
| 436 | 388 |
| 437 } // namespace policy | 389 } // namespace policy |
| OLD | NEW |