Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: chrome/browser/chromeos/policy/login_screen_default_policy_browsertest.cc

Issue 2476493003: Remove FundamentalValue
Patch Set: Fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/common/accessibility_types.h" 7 #include "ash/common/accessibility_types.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // take effect. 243 // take effect.
244 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); 244 em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
245 proto.mutable_accessibility_settings()-> 245 proto.mutable_accessibility_settings()->
246 set_login_screen_default_large_cursor_enabled(true); 246 set_login_screen_default_large_cursor_enabled(true);
247 RefreshDevicePolicyAndWaitForPrefChange( 247 RefreshDevicePolicyAndWaitForPrefChange(
248 prefs::kAccessibilityLargeCursorEnabled); 248 prefs::kAccessibilityLargeCursorEnabled);
249 249
250 // Verify that the pref which controls the large cursor in the login profile 250 // Verify that the pref which controls the large cursor in the login profile
251 // has changed to the policy-supplied default. 251 // has changed to the policy-supplied default.
252 VerifyPrefFollowsRecommendation(prefs::kAccessibilityLargeCursorEnabled, 252 VerifyPrefFollowsRecommendation(prefs::kAccessibilityLargeCursorEnabled,
253 base::FundamentalValue(true)); 253 base::Value(true));
254 254
255 // Verify that the large cursor is enabled. 255 // Verify that the large cursor is enabled.
256 chromeos::AccessibilityManager* accessibility_manager = 256 chromeos::AccessibilityManager* accessibility_manager =
257 chromeos::AccessibilityManager::Get(); 257 chromeos::AccessibilityManager::Get();
258 ASSERT_TRUE(accessibility_manager); 258 ASSERT_TRUE(accessibility_manager);
259 EXPECT_TRUE(accessibility_manager->IsLargeCursorEnabled()); 259 EXPECT_TRUE(accessibility_manager->IsLargeCursorEnabled());
260 } 260 }
261 261
262 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest, 262 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest,
263 DeviceLoginScreenDefaultSpokenFeedbackEnabled) { 263 DeviceLoginScreenDefaultSpokenFeedbackEnabled) {
264 // Verifies that the default state of the spoken feedback accessibility 264 // Verifies that the default state of the spoken feedback accessibility
265 // feature on the login screen can be controlled through device policy. 265 // feature on the login screen can be controlled through device policy.
266 266
267 // Enable spoken feedback through device policy and wait for the change to 267 // Enable spoken feedback through device policy and wait for the change to
268 // take effect. 268 // take effect.
269 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); 269 em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
270 proto.mutable_accessibility_settings()-> 270 proto.mutable_accessibility_settings()->
271 set_login_screen_default_spoken_feedback_enabled(true); 271 set_login_screen_default_spoken_feedback_enabled(true);
272 RefreshDevicePolicyAndWaitForPrefChange( 272 RefreshDevicePolicyAndWaitForPrefChange(
273 prefs::kAccessibilitySpokenFeedbackEnabled); 273 prefs::kAccessibilitySpokenFeedbackEnabled);
274 274
275 // Verify that the pref which controls spoken feedback in the login profile 275 // Verify that the pref which controls spoken feedback in the login profile
276 // has changed to the policy-supplied default. 276 // has changed to the policy-supplied default.
277 VerifyPrefFollowsRecommendation(prefs::kAccessibilitySpokenFeedbackEnabled, 277 VerifyPrefFollowsRecommendation(prefs::kAccessibilitySpokenFeedbackEnabled,
278 base::FundamentalValue(true)); 278 base::Value(true));
279 279
280 // Verify that spoken feedback is enabled. 280 // Verify that spoken feedback is enabled.
281 chromeos::AccessibilityManager* accessibility_manager = 281 chromeos::AccessibilityManager* accessibility_manager =
282 chromeos::AccessibilityManager::Get(); 282 chromeos::AccessibilityManager::Get();
283 ASSERT_TRUE(accessibility_manager); 283 ASSERT_TRUE(accessibility_manager);
284 EXPECT_TRUE(accessibility_manager->IsSpokenFeedbackEnabled()); 284 EXPECT_TRUE(accessibility_manager->IsSpokenFeedbackEnabled());
285 } 285 }
286 286
287 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest, 287 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest,
288 DeviceLoginScreenDefaultHighContrastEnabled) { 288 DeviceLoginScreenDefaultHighContrastEnabled) {
289 // Verifies that the default state of the high contrast mode accessibility 289 // Verifies that the default state of the high contrast mode accessibility
290 // feature on the login screen can be controlled through device policy. 290 // feature on the login screen can be controlled through device policy.
291 291
292 // Enable high contrast mode through device policy and wait for the change to 292 // Enable high contrast mode through device policy and wait for the change to
293 // take effect. 293 // take effect.
294 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); 294 em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
295 proto.mutable_accessibility_settings()-> 295 proto.mutable_accessibility_settings()->
296 set_login_screen_default_high_contrast_enabled(true); 296 set_login_screen_default_high_contrast_enabled(true);
297 RefreshDevicePolicyAndWaitForPrefChange( 297 RefreshDevicePolicyAndWaitForPrefChange(
298 prefs::kAccessibilityHighContrastEnabled); 298 prefs::kAccessibilityHighContrastEnabled);
299 299
300 // Verify that the pref which controls high contrast mode in the login profile 300 // Verify that the pref which controls high contrast mode in the login profile
301 // has changed to the policy-supplied default. 301 // has changed to the policy-supplied default.
302 VerifyPrefFollowsRecommendation(prefs::kAccessibilityHighContrastEnabled, 302 VerifyPrefFollowsRecommendation(prefs::kAccessibilityHighContrastEnabled,
303 base::FundamentalValue(true)); 303 base::Value(true));
304 304
305 // Verify that high contrast mode is enabled. 305 // Verify that high contrast mode is enabled.
306 chromeos::AccessibilityManager* accessibility_manager = 306 chromeos::AccessibilityManager* accessibility_manager =
307 chromeos::AccessibilityManager::Get(); 307 chromeos::AccessibilityManager::Get();
308 ASSERT_TRUE(accessibility_manager); 308 ASSERT_TRUE(accessibility_manager);
309 EXPECT_TRUE(accessibility_manager->IsHighContrastEnabled()); 309 EXPECT_TRUE(accessibility_manager->IsHighContrastEnabled());
310 } 310 }
311 311
312 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest, 312 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest,
313 DeviceLoginScreenDefaultScreenMagnifierType) { 313 DeviceLoginScreenDefaultScreenMagnifierType) {
314 // Verifies that the default screen magnifier type enabled on the login screen 314 // Verifies that the default screen magnifier type enabled on the login screen
315 // can be controlled through device policy. 315 // can be controlled through device policy.
316 316
317 // Set the screen magnifier type through device policy and wait for the change 317 // Set the screen magnifier type through device policy and wait for the change
318 // to take effect. 318 // to take effect.
319 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); 319 em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
320 proto.mutable_accessibility_settings()-> 320 proto.mutable_accessibility_settings()->
321 set_login_screen_default_screen_magnifier_type(kFullScreenMagnifier); 321 set_login_screen_default_screen_magnifier_type(kFullScreenMagnifier);
322 RefreshDevicePolicyAndWaitForPrefChange( 322 RefreshDevicePolicyAndWaitForPrefChange(
323 prefs::kAccessibilityScreenMagnifierType); 323 prefs::kAccessibilityScreenMagnifierType);
324 324
325 // Verify that the prefs which control the screen magnifier type have changed 325 // Verify that the prefs which control the screen magnifier type have changed
326 // to the policy-supplied default. 326 // to the policy-supplied default.
327 VerifyPrefFollowsRecommendation(prefs::kAccessibilityScreenMagnifierEnabled, 327 VerifyPrefFollowsRecommendation(prefs::kAccessibilityScreenMagnifierEnabled,
328 base::FundamentalValue(true)); 328 base::Value(true));
329 VerifyPrefFollowsRecommendation(prefs::kAccessibilityScreenMagnifierType, 329 VerifyPrefFollowsRecommendation(prefs::kAccessibilityScreenMagnifierType,
330 base::FundamentalValue(ash::MAGNIFIER_FULL)); 330 base::Value(ash::MAGNIFIER_FULL));
331 331
332 // Verify that the full-screen magnifier is enabled. 332 // Verify that the full-screen magnifier is enabled.
333 chromeos::MagnificationManager* magnification_manager = 333 chromeos::MagnificationManager* magnification_manager =
334 chromeos::MagnificationManager::Get(); 334 chromeos::MagnificationManager::Get();
335 ASSERT_TRUE(magnification_manager); 335 ASSERT_TRUE(magnification_manager);
336 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); 336 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled());
337 EXPECT_EQ(ash::MAGNIFIER_FULL, magnification_manager->GetMagnifierType()); 337 EXPECT_EQ(ash::MAGNIFIER_FULL, magnification_manager->GetMagnifierType());
338 } 338 }
339 339
340 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyInSessionBrowsertest, 340 IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyInSessionBrowsertest,
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // to take effect. 448 // to take effect.
449 em::ChromeDeviceSettingsProto& proto(device_policy()->payload()); 449 em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
450 proto.mutable_accessibility_settings()-> 450 proto.mutable_accessibility_settings()->
451 set_login_screen_default_virtual_keyboard_enabled(true); 451 set_login_screen_default_virtual_keyboard_enabled(true);
452 RefreshDevicePolicyAndWaitForPrefChange( 452 RefreshDevicePolicyAndWaitForPrefChange(
453 prefs::kAccessibilityVirtualKeyboardEnabled); 453 prefs::kAccessibilityVirtualKeyboardEnabled);
454 454
455 // Verify that the pref which controls the on-screen keyboard in the login 455 // Verify that the pref which controls the on-screen keyboard in the login
456 // profile has changed to the policy-supplied default. 456 // profile has changed to the policy-supplied default.
457 VerifyPrefFollowsRecommendation(prefs::kAccessibilityVirtualKeyboardEnabled, 457 VerifyPrefFollowsRecommendation(prefs::kAccessibilityVirtualKeyboardEnabled,
458 base::FundamentalValue(true)); 458 base::Value(true));
459 459
460 // Verify that the on-screen keyboard is enabled. 460 // Verify that the on-screen keyboard is enabled.
461 chromeos::AccessibilityManager* accessibility_manager = 461 chromeos::AccessibilityManager* accessibility_manager =
462 chromeos::AccessibilityManager::Get(); 462 chromeos::AccessibilityManager::Get();
463 ASSERT_TRUE(accessibility_manager); 463 ASSERT_TRUE(accessibility_manager);
464 EXPECT_TRUE(accessibility_manager->IsVirtualKeyboardEnabled()); 464 EXPECT_TRUE(accessibility_manager->IsVirtualKeyboardEnabled());
465 } 465 }
466 466
467 } // namespace policy 467 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698