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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 320223002: Add device policy: Kiosk Virtual Keyboard Layout. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo. Created 6 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 6a40f263c5a905d5a9e6467808220c31854695ca..1c043630fde6bd124fd44c10f3771c01293717a1 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -151,6 +151,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/screenshot_taker.h"
#include "chromeos/audio/cras_audio_handler.h"
+#include "ui/keyboard/keyboard_util.h"
#endif
#if !defined(OS_MACOSX)
@@ -2414,7 +2415,7 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, ScreenMagnifierTypeFull) {
EXPECT_TRUE(magnification_manager->IsMagnifierEnabled());
}
-IN_PROC_BROWSER_TEST_F(PolicyTest, VirtualKeyboardEnabled) {
+IN_PROC_BROWSER_TEST_F(PolicyTest, AccessibilityVirtualKeyboardEnabled) {
// Verifies that the on-screen keyboard accessibility feature can be
// controlled through policy.
chromeos::AccessibilityManager* accessibility_manager =
@@ -2437,6 +2438,39 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, VirtualKeyboardEnabled) {
EXPECT_FALSE(accessibility_manager->IsVirtualKeyboardEnabled());
}
+IN_PROC_BROWSER_TEST_F(PolicyTest, VirtualKeyboardEnabled) {
+ // Verify keyboard disabled by default.
+ EXPECT_FALSE(keyboard::IsKeyboardEnabled());
+ // Verify keyboard can be toggled by default.
+ keyboard::SetTouchKeyboardEnabled(true);
+ EXPECT_TRUE(keyboard::IsKeyboardEnabled());
+ keyboard::SetTouchKeyboardEnabled(false);
+ EXPECT_FALSE(keyboard::IsKeyboardEnabled());
+
+ // Verify policy can enable the keyboard.
+ PolicyMap policies;
+ policies.Set(key::kTouchVirtualKeyboardEnabled,
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ base::Value::CreateBooleanValue(true),
+ NULL);
+ UpdateProviderPolicy(policies);
+ EXPECT_TRUE(keyboard::IsKeyboardEnabled());
+ keyboard::SetTouchKeyboardEnabled(false);
+ EXPECT_TRUE(keyboard::IsKeyboardEnabled());
+
+ // Verify that user cannot set keyboard enabled when policy disables it.
bartfab (slow) 2014/06/16 14:14:02 Nit: This should be made consistent with the comme
rsadam 2014/06/16 14:35:38 Done.
+ policies.Set(key::kTouchVirtualKeyboardEnabled,
+ POLICY_LEVEL_MANDATORY,
+ POLICY_SCOPE_USER,
+ base::Value::CreateBooleanValue(false),
+ NULL);
+ UpdateProviderPolicy(policies);
+ EXPECT_FALSE(keyboard::IsKeyboardEnabled());
+ keyboard::SetTouchKeyboardEnabled(true);
+ EXPECT_FALSE(keyboard::IsKeyboardEnabled());
+}
+
#endif
namespace {

Powered by Google App Engine
This is Rietveld 408576698