#include <string>
-#include "ash/magnifier/magnifier_constants.h"
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "chrome/browser/chromeos/policy/device_policy_cros_browser_test.h"
#include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
-#include "chrome/browser/chromeos/settings/device_settings_service.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/pref_names.h"
#include "chromeos/chromeos_switches.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/chromeos/accessibility_types.h"
namespace em = enterprise_management;
virtual ~LoginScreenDefaultPolicyBrowsertestBase();
// DevicePolicyCrosBrowserTest:
- virtual void SetUpInProcessBrowserTestFixture() OVERRIDE;
- virtual void SetUpOnMainThread() OVERRIDE;
+ virtual void SetUpInProcessBrowserTestFixture() override;
+ virtual void SetUpOnMainThread() override;
void RefreshDevicePolicyAndWaitForPrefChange(const char* pref_name);
virtual ~LoginScreenDefaultPolicyLoginScreenBrowsertest();
// LoginScreenDefaultPolicyBrowsertestBase:
- virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
- virtual void SetUpOnMainThread() OVERRIDE;
- virtual void CleanUpOnMainThread() OVERRIDE;
+ virtual void SetUpCommandLine(CommandLine* command_line) override;
+ virtual void SetUpOnMainThread() override;
+ virtual void TearDownOnMainThread() override;
void VerifyPrefFollowsRecommendation(const char* pref_name,
const base::Value& recommended_value);
virtual ~LoginScreenDefaultPolicyInSessionBrowsertest();
// LoginScreenDefaultPolicyBrowsertestBase:
- virtual void SetUpOnMainThread() OVERRIDE;
+ virtual void SetUpOnMainThread() override;
void VerifyPrefFollowsDefault(const char* pref_name);
chromeos::ProfileHelper::GetSigninProfile());
}
-void LoginScreenDefaultPolicyLoginScreenBrowsertest::CleanUpOnMainThread() {
+void LoginScreenDefaultPolicyLoginScreenBrowsertest::TearDownOnMainThread() {
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(&chrome::AttemptExit));
base::RunLoop().RunUntilIdle();
- LoginScreenDefaultPolicyBrowsertestBase::CleanUpOnMainThread();
+ LoginScreenDefaultPolicyBrowsertestBase::TearDownOnMainThread();
}
void LoginScreenDefaultPolicyLoginScreenBrowsertest::
void LoginScreenDefaultPolicyInSessionBrowsertest::SetUpOnMainThread() {
LoginScreenDefaultPolicyBrowsertestBase::SetUpOnMainThread();
-
- // Tell the DeviceSettingsService that there is no local owner.
- chromeos::DeviceSettingsService::Get()->SetUsername(std::string());
}
void LoginScreenDefaultPolicyInSessionBrowsertest::VerifyPrefFollowsDefault(
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_large_cursor_enabled(true);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kLargeCursorEnabled);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilityLargeCursorEnabled);
// Verify that the pref which controls the large cursor in the login profile
// has changed to the policy-supplied default.
- VerifyPrefFollowsRecommendation(prefs::kLargeCursorEnabled,
+ VerifyPrefFollowsRecommendation(prefs::kAccessibilityLargeCursorEnabled,
base::FundamentalValue(true));
// Verify that the large cursor is enabled.
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_spoken_feedback_enabled(true);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kSpokenFeedbackEnabled);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilitySpokenFeedbackEnabled);
// Verify that the pref which controls spoken feedback in the login profile
// has changed to the policy-supplied default.
- VerifyPrefFollowsRecommendation(prefs::kSpokenFeedbackEnabled,
+ VerifyPrefFollowsRecommendation(prefs::kAccessibilitySpokenFeedbackEnabled,
base::FundamentalValue(true));
// Verify that spoken feedback is enabled.
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_high_contrast_enabled(true);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kHighContrastEnabled);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilityHighContrastEnabled);
// Verify that the pref which controls high contrast mode in the login profile
// has changed to the policy-supplied default.
- VerifyPrefFollowsRecommendation(prefs::kHighContrastEnabled,
+ VerifyPrefFollowsRecommendation(prefs::kAccessibilityHighContrastEnabled,
base::FundamentalValue(true));
// Verify that high contrast mode is enabled.
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_screen_magnifier_type(kFullScreenMagnifier);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kScreenMagnifierType);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilityScreenMagnifierType);
// Verify that the prefs which control the screen magnifier type have changed
// to the policy-supplied default.
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierEnabled,
+ VerifyPrefFollowsRecommendation(prefs::kAccessibilityScreenMagnifierEnabled,
base::FundamentalValue(true));
- VerifyPrefFollowsRecommendation(prefs::kScreenMagnifierType,
- base::FundamentalValue(ash::MAGNIFIER_FULL));
+ VerifyPrefFollowsRecommendation(prefs::kAccessibilityScreenMagnifierType,
+ base::FundamentalValue(ui::MAGNIFIER_FULL));
// Verify that the full-screen magnifier is enabled.
chromeos::MagnificationManager* magnification_manager =
chromeos::MagnificationManager::Get();
ASSERT_TRUE(magnification_manager);
EXPECT_TRUE(magnification_manager->IsMagnifierEnabled());
- EXPECT_EQ(ash::MAGNIFIER_FULL, magnification_manager->GetMagnifierType());
+ EXPECT_EQ(ui::MAGNIFIER_FULL, magnification_manager->GetMagnifierType());
}
IN_PROC_BROWSER_TEST_F(LoginScreenDefaultPolicyInSessionBrowsertest,
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_large_cursor_enabled(true);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kLargeCursorEnabled);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilityLargeCursorEnabled);
// Verify that the pref which controls the large cursor in the session is
// unchanged.
- VerifyPrefFollowsDefault(prefs::kLargeCursorEnabled);
+ VerifyPrefFollowsDefault(prefs::kAccessibilityLargeCursorEnabled);
// Verify that the large cursor is disabled.
chromeos::AccessibilityManager* accessibility_manager =
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_spoken_feedback_enabled(true);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kSpokenFeedbackEnabled);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilitySpokenFeedbackEnabled);
// Verify that the pref which controls the spoken feedback in the session is
// unchanged.
- VerifyPrefFollowsDefault(prefs::kSpokenFeedbackEnabled);
+ VerifyPrefFollowsDefault(prefs::kAccessibilitySpokenFeedbackEnabled);
// Verify that spoken feedback is disabled.
chromeos::AccessibilityManager* accessibility_manager =
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_high_contrast_enabled(true);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kHighContrastEnabled);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilityHighContrastEnabled);
// Verify that the pref which controls high contrast mode in the session is
// unchanged.
- VerifyPrefFollowsDefault(prefs::kHighContrastEnabled);
+ VerifyPrefFollowsDefault(prefs::kAccessibilityHighContrastEnabled);
// Verify that high contrast mode is disabled.
chromeos::AccessibilityManager* accessibility_manager =
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_screen_magnifier_type(kFullScreenMagnifier);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kScreenMagnifierType);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilityScreenMagnifierType);
// Verify that the prefs which control the screen magnifier in the session are
// unchanged.
- VerifyPrefFollowsDefault(prefs::kScreenMagnifierEnabled);
- VerifyPrefFollowsDefault(prefs::kScreenMagnifierType);
+ VerifyPrefFollowsDefault(prefs::kAccessibilityScreenMagnifierEnabled);
+ VerifyPrefFollowsDefault(prefs::kAccessibilityScreenMagnifierType);
// Verify that the screen magnifier is disabled.
chromeos::MagnificationManager* magnification_manager =
chromeos::MagnificationManager::Get();
ASSERT_TRUE(magnification_manager);
EXPECT_FALSE(magnification_manager->IsMagnifierEnabled());
- EXPECT_EQ(ash::kDefaultMagnifierType,
+ EXPECT_EQ(ui::kDefaultMagnifierType,
magnification_manager->GetMagnifierType());
}
em::ChromeDeviceSettingsProto& proto(device_policy()->payload());
proto.mutable_accessibility_settings()->
set_login_screen_default_virtual_keyboard_enabled(true);
- RefreshDevicePolicyAndWaitForPrefChange(prefs::kVirtualKeyboardEnabled);
+ RefreshDevicePolicyAndWaitForPrefChange(
+ prefs::kAccessibilityVirtualKeyboardEnabled);
// Verify that the pref which controls the on-screen keyboard in the login
// profile has changed to the policy-supplied default.
- VerifyPrefFollowsRecommendation(prefs::kVirtualKeyboardEnabled,
+ VerifyPrefFollowsRecommendation(prefs::kAccessibilityVirtualKeyboardEnabled,
base::FundamentalValue(true));
// Verify that the on-screen keyboard is enabled.