Index: chrome/browser/chromeos/system/tray_accessibility_browsertest.cc |
diff --git a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc |
index 5ac1019b66fda756e88630887bd92e03d019c603..0a8f87b9598a56b560b7d84174072c1e7d50df94 100644 |
--- a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc |
+++ b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc |
@@ -31,8 +31,8 @@ |
namespace chromeos { |
-namespace { |
- ui::MouseEvent& dummyEvent = *((ui::MouseEvent*)0); |
+void SetMagnifierEnabled(bool enabled) { |
+ MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
} |
class TrayAccessibilityTest : public CrosInProcessBrowserTest { |
@@ -151,13 +151,13 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowTrayIcon) { |
EXPECT_FALSE(IsTrayIconVisible()); |
// Toggling magnifier the visibillity of the icon. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(IsTrayIconVisible()); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_FALSE(IsTrayIconVisible()); |
// Enabling all accessibility features. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(IsTrayIconVisible()); |
accessibility::EnableHighContrast(true); |
EXPECT_TRUE(IsTrayIconVisible()); |
@@ -167,7 +167,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowTrayIcon) { |
EXPECT_TRUE(IsTrayIconVisible()); |
accessibility::EnableHighContrast(false); |
EXPECT_TRUE(IsTrayIconVisible()); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_FALSE(IsTrayIconVisible()); |
// Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect |
@@ -209,13 +209,13 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenu) { |
EXPECT_FALSE(CanCreateMenuItem()); |
// Toggling screen magnifier changes the visibillity of the menu. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_FALSE(CanCreateMenuItem()); |
// Enabling all accessibility features. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
accessibility::EnableHighContrast(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
@@ -225,7 +225,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenu) { |
EXPECT_TRUE(CanCreateMenuItem()); |
accessibility::EnableHighContrast(false); |
EXPECT_TRUE(CanCreateMenuItem()); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_FALSE(CanCreateMenuItem()); |
} |
@@ -256,13 +256,13 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { |
EXPECT_TRUE(CanCreateMenuItem()); |
// The menu is keeping visible regardless of toggling screen magnifier. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_TRUE(CanCreateMenuItem()); |
// Enabling all accessibility features. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
accessibility::EnableHighContrast(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
@@ -272,7 +272,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowMenuOption) { |
EXPECT_TRUE(CanCreateMenuItem()); |
accessibility::EnableHighContrast(false); |
EXPECT_TRUE(CanCreateMenuItem()); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_TRUE(CanCreateMenuItem()); |
// Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. |
@@ -301,13 +301,13 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { |
EXPECT_TRUE(CanCreateMenuItem()); |
// The menu is keeping visible regardless of toggling screen magnifier. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_TRUE(CanCreateMenuItem()); |
// Enabling all accessibility features. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
accessibility::EnableHighContrast(true); |
EXPECT_TRUE(CanCreateMenuItem()); |
@@ -317,7 +317,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) { |
EXPECT_TRUE(CanCreateMenuItem()); |
accessibility::EnableHighContrast(false); |
EXPECT_TRUE(CanCreateMenuItem()); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_TRUE(CanCreateMenuItem()); |
// Sets prefs::kShouldAlwaysShowAccessibilityMenu = true. |
@@ -363,17 +363,14 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ClickDetailMenu) { |
// Confirms that the check item toggles the magnifier. |
EXPECT_FALSE(accessibility::IsHighContrastEnabled()); |
- EXPECT_EQ(ash::MAGNIFIER_OFF, |
- MagnificationManager::Get()->GetMagnifierType()); |
+ EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled()); |
EXPECT_TRUE(CreateDetailedMenu()); |
ClickScreenMagnifierOnDetailMenu(); |
- EXPECT_EQ(ash::MAGNIFIER_FULL, |
- MagnificationManager::Get()->GetMagnifierType()); |
+ EXPECT_TRUE(MagnificationManager::Get()->IsMagnifierEnabled()); |
EXPECT_TRUE(CreateDetailedMenu()); |
ClickScreenMagnifierOnDetailMenu(); |
- EXPECT_EQ(ash::MAGNIFIER_OFF, |
- MagnificationManager::Get()->GetMagnifierType()); |
+ EXPECT_FALSE(MagnificationManager::Get()->IsMagnifierEnabled()); |
} |
IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { |
@@ -417,7 +414,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { |
CloseDetailMenu(); |
// Enabling full screen magnifier. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(CreateDetailedMenu()); |
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
@@ -425,7 +422,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { |
CloseDetailMenu(); |
// Disabling screen magnifier. |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_TRUE(CreateDetailedMenu()); |
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
@@ -435,7 +432,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { |
// Enabling all of the a11y features. |
accessibility::EnableSpokenFeedback(true, NULL, ash::A11Y_NOTIFICATION_NONE); |
accessibility::EnableHighContrast(true); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL); |
+ SetMagnifierEnabled(true); |
EXPECT_TRUE(CreateDetailedMenu()); |
EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu()); |
EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu()); |
@@ -445,7 +442,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) { |
// Disabling all of the a11y features. |
accessibility::EnableSpokenFeedback(false, NULL, ash::A11Y_NOTIFICATION_NONE); |
accessibility::EnableHighContrast(false); |
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF); |
+ SetMagnifierEnabled(false); |
EXPECT_TRUE(CreateDetailedMenu()); |
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |