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

Unified Diff: chrome/browser/chromeos/system/tray_accessibility_browsertest.cc

Issue 11642014: Re-introduce the partial magnifier (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/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..8361c13e48f21c67f9ded4fd09a252972b5937e8 100644
--- a/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc
+++ b/chrome/browser/chromeos/system/tray_accessibility_browsertest.cc
@@ -31,8 +31,13 @@
namespace chromeos {
-namespace {
- ui::MouseEvent& dummyEvent = *((ui::MouseEvent*)0);
+void EnableMagnifier() {
+ MagnificationManager::Get()->SetMagnifier(true, ash::MAGNIFIER_TYPE_UNCHANGE);
+}
+
+void DisableMagnifier() {
+ MagnificationManager::Get()->SetMagnifier(false,
+ ash::MAGNIFIER_TYPE_UNCHANGE);
}
class TrayAccessibilityTest : public CrosInProcessBrowserTest {
@@ -151,13 +156,13 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowTrayIcon) {
EXPECT_FALSE(IsTrayIconVisible());
// Toggling magnifier the visibillity of the icon.
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL);
+ EnableMagnifier();
EXPECT_TRUE(IsTrayIconVisible());
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_FALSE(IsTrayIconVisible());
// Enabling all accessibility features.
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL);
+ EnableMagnifier();
EXPECT_TRUE(IsTrayIconVisible());
accessibility::EnableHighContrast(true);
EXPECT_TRUE(IsTrayIconVisible());
@@ -167,7 +172,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowTrayIcon) {
EXPECT_TRUE(IsTrayIconVisible());
accessibility::EnableHighContrast(false);
EXPECT_TRUE(IsTrayIconVisible());
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_FALSE(IsTrayIconVisible());
// Confirms that prefs::kShouldAlwaysShowAccessibilityMenu doesn't affect
@@ -209,13 +214,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);
+ EnableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_FALSE(CanCreateMenuItem());
// Enabling all accessibility features.
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL);
+ EnableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
accessibility::EnableHighContrast(true);
EXPECT_TRUE(CanCreateMenuItem());
@@ -225,7 +230,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenu) {
EXPECT_TRUE(CanCreateMenuItem());
accessibility::EnableHighContrast(false);
EXPECT_TRUE(CanCreateMenuItem());
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_FALSE(CanCreateMenuItem());
}
@@ -256,13 +261,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);
+ EnableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
// Enabling all accessibility features.
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL);
+ EnableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
accessibility::EnableHighContrast(true);
EXPECT_TRUE(CanCreateMenuItem());
@@ -272,7 +277,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowMenuOption) {
EXPECT_TRUE(CanCreateMenuItem());
accessibility::EnableHighContrast(false);
EXPECT_TRUE(CanCreateMenuItem());
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
// Sets prefs::kShouldAlwaysShowAccessibilityMenu = true.
@@ -301,13 +306,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);
+ EnableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
// Enabling all accessibility features.
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL);
+ EnableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
accessibility::EnableHighContrast(true);
EXPECT_TRUE(CanCreateMenuItem());
@@ -317,7 +322,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, ShowMenuWithShowOnLoginScreen) {
EXPECT_TRUE(CanCreateMenuItem());
accessibility::EnableHighContrast(false);
EXPECT_TRUE(CanCreateMenuItem());
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_TRUE(CanCreateMenuItem());
// Sets prefs::kShouldAlwaysShowAccessibilityMenu = true.
@@ -363,17 +368,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 +419,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) {
CloseDetailMenu();
// Enabling full screen magnifier.
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_FULL);
+ EnableMagnifier();
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
@@ -425,7 +427,7 @@ IN_PROC_BROWSER_TEST_F(TrayAccessibilityTest, CheckMarksOnDetailMenu) {
CloseDetailMenu();
// Disabling screen magnifier.
- MagnificationManager::Get()->SetMagnifier(ash::MAGNIFIER_OFF);
+ DisableMagnifier();
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());
@@ -435,7 +437,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);
+ EnableMagnifier();
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_TRUE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_TRUE(IsHighContrastEnabledOnDetailMenu());
@@ -445,7 +447,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);
+ DisableMagnifier();
EXPECT_TRUE(CreateDetailedMenu());
EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu());
EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu());

Powered by Google App Engine
This is Rietveld 408576698