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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 155573003: Add policy management for on-screen keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update recommendation restorer. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 base::Value::CreateIntegerValue(ash::MAGNIFIER_FULL), NULL); 2417 base::Value::CreateIntegerValue(ash::MAGNIFIER_FULL), NULL);
2418 UpdateProviderPolicy(policies); 2418 UpdateProviderPolicy(policies);
2419 EXPECT_EQ(ash::MAGNIFIER_FULL, magnification_manager->GetMagnifierType()); 2419 EXPECT_EQ(ash::MAGNIFIER_FULL, magnification_manager->GetMagnifierType());
2420 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); 2420 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled());
2421 2421
2422 // Verify that the screen magnifier cannot be disabled manually anymore. 2422 // Verify that the screen magnifier cannot be disabled manually anymore.
2423 magnification_manager->SetMagnifierEnabled(false); 2423 magnification_manager->SetMagnifierEnabled(false);
2424 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled()); 2424 EXPECT_TRUE(magnification_manager->IsMagnifierEnabled());
2425 } 2425 }
2426 2426
2427 IN_PROC_BROWSER_TEST_F(PolicyTest, VirtualKeyboardEnabled) {
2428 // Verifies that the on-screen keyboard accessibility feature can be
2429 // controlled through policy.
2430 chromeos::AccessibilityManager* accessibility_manager =
2431 chromeos::AccessibilityManager::Get();
2432
2433 // Manually enable the on-screen keyboard.
2434 accessibility_manager->EnableVirtualKeyboard(true);
2435 EXPECT_TRUE(accessibility_manager->IsVirtualKeyboardEnabled());
2436
2437 // Verify that policy overrides the manual setting.
2438 PolicyMap policies;
2439 policies.Set(key::kVirtualKeyboardEnabled, POLICY_LEVEL_MANDATORY,
2440 POLICY_SCOPE_USER,
2441 base::Value::CreateBooleanValue(false), NULL);
2442 UpdateProviderPolicy(policies);
2443 EXPECT_FALSE(accessibility_manager->IsVirtualKeyboardEnabled());
2444
2445 // Verify that the on-screen keyboard cannot be enabled manually anymore.
2446 accessibility_manager->EnableVirtualKeyboard(true);
2447 EXPECT_FALSE(accessibility_manager->IsVirtualKeyboardEnabled());
2448 }
2449
2427 #endif 2450 #endif
2428 2451
2429 namespace { 2452 namespace {
2430 2453
2431 static const char* kRestoredURLs[] = { 2454 static const char* kRestoredURLs[] = {
2432 "http://aaa.com/empty.html", 2455 "http://aaa.com/empty.html",
2433 "http://bbb.com/empty.html", 2456 "http://bbb.com/empty.html",
2434 }; 2457 };
2435 2458
2436 bool IsNonSwitchArgument(const CommandLine::StringType& s) { 2459 bool IsNonSwitchArgument(const CommandLine::StringType& s) {
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
2958 PrefService* prefs = browser()->profile()->GetPrefs(); 2981 PrefService* prefs = browser()->profile()->GetPrefs();
2959 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed( 2982 EXPECT_TRUE(extensions::NativeMessageProcessHost::IsHostAllowed(
2960 prefs, "host.name")); 2983 prefs, "host.name"));
2961 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed( 2984 EXPECT_FALSE(extensions::NativeMessageProcessHost::IsHostAllowed(
2962 prefs, "other.host.name")); 2985 prefs, "other.host.name"));
2963 } 2986 }
2964 2987
2965 #endif // !defined(CHROME_OS) 2988 #endif // !defined(CHROME_OS)
2966 2989
2967 } // namespace policy 2990 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_handler_list_factory.cc ('k') | chrome/browser/resources/chromeos/login/oobe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698