Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / policy / login_screen_default_policy_browsertest.cc
index c08606f..d37f7af 100644 (file)
@@ -434,4 +434,28 @@ IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyInSessionBrowsertest,
             magnification_manager->GetMagnifierType());
 }
 
+IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyLoginScreenBrowsertest,
+                       DeviceLoginScreenDefaultVirtualKeyboardEnabled) {
+  // Verifies that the default state of the on-screen keyboard accessibility
+  // feature on the login screen can be controlled through device policy.
+
+  // Enable the on-screen keyboard through device policy and wait for the change
+  // to take effect.
+  em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
+  proto.mutable_accessibility_settings()->
+      set_login_screen_default_virtual_keyboard_enabled(true);
+  RefreshDevicePolicyAndWaitForPrefChange(prefs::kVirtualKeyboardEnabled);
+
+  // Verify that the pref which controls the on-screen keyboard in the login
+  // profile has changed to the policy-supplied default.
+  VerifyPrefFollowsRecommendation(prefs::kVirtualKeyboardEnabled,
+                                  base::FundamentalValue(true));
+
+  // Verify that the on-screen keyboard is enabled.
+  chromeos::AccessibilityManager* accessibility_manager =
+      chromeos::AccessibilityManager::Get();
+  ASSERT_TRUE(accessibility_manager);
+  EXPECT_TRUE(accessibility_manager->IsVirtualKeyboardEnabled());
+}
+
 } // namespace policy