X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fchrome%2Fbrowser%2Fchromeos%2Faccessibility%2Fmagnification_manager_browsertest.cc;h=2bef6d6b090b99da35a322e219d127570bc0c72e;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=719a633443cca7fc13edd9044ffa68088ab5d102;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc b/src/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc index 719a633..2bef6d6 100644 --- a/src/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc +++ b/src/chrome/browser/chromeos/accessibility/magnification_manager_browsertest.cc @@ -37,7 +37,7 @@ void SetMagnifierEnabled(bool enabled) { MagnificationManager::Get()->SetMagnifierEnabled(enabled); } -void SetMagnifierType(ash::MagnifierType type) { +void SetMagnifierType(ui::MagnifierType type) { MagnificationManager::Get()->SetMagnifierType(type); } @@ -58,7 +58,7 @@ double GetSavedFullScreenMagnifierScale() { return MagnificationManager::Get()->GetSavedScreenMagnifierScale(); } -ash::MagnifierType GetMagnifierType() { +ui::MagnifierType GetMagnifierType() { return MagnificationManager::Get()->GetMagnifierType(); } @@ -80,7 +80,7 @@ void SetScreenMagnifierEnabledPref(bool enabled) { prefs()->SetBoolean(prefs::kAccessibilityScreenMagnifierEnabled, enabled); } -void SetScreenMagnifierTypePref(ash::MagnifierType type) { +void SetScreenMagnifierTypePref(ui::MagnifierType type) { prefs()->SetInteger(prefs::kAccessibilityScreenMagnifierType, type); } @@ -152,13 +152,13 @@ class MagnificationManagerTest : public InProcessBrowserTest { MagnificationManagerTest() {} virtual ~MagnificationManagerTest() {} - virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { + virtual void SetUpCommandLine(CommandLine* command_line) override { command_line->AppendSwitch(switches::kLoginManager); command_line->AppendSwitchASCII(switches::kLoginProfile, TestingProfile::kTestUserProfileDir); } - virtual void SetUpOnMainThread() OVERRIDE { + virtual void SetUpOnMainThread() override { // Set the login-screen profile. MagnificationManager::Get()->SetProfileForTest( ProfileManager::GetActiveUserProfile()); @@ -199,7 +199,7 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToOff) { SetMagnifierEnabled(true); // Confirms that magnifier is enabled. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); } @@ -217,10 +217,10 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToOff) { // Enables magnifier on login screen. SetMagnifierEnabled(true); - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); SetFullScreenMagnifierScale(2.5); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); // Logs in (but the session is not started yet). @@ -229,7 +229,7 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToOff) { // Confirms that magnifier is keeping enabled. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); user_manager::UserManager::Get()->SessionStarted(); @@ -244,7 +244,7 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginOffToFull) { // Sets prefs to explicitly enable the magnifier. SetScreenMagnifierEnabledPref(true); - SetScreenMagnifierTypePref(ash::MAGNIFIER_FULL); + SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL); SetFullScreenMagnifierScalePref(2.5); } @@ -265,7 +265,7 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginOffToFull) { // Confirms that the magnifier is enabled and configured according to the // explicitly set prefs just after session start. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); } @@ -276,17 +276,17 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToFull) { // Sets prefs to explicitly enable the magnifier. SetScreenMagnifierEnabledPref(true); - SetScreenMagnifierTypePref(ash::MAGNIFIER_FULL); + SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL); SetFullScreenMagnifierScalePref(2.5); } IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToFull) { // Enables magnifier on login screen. - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); SetMagnifierEnabled(true); SetFullScreenMagnifierScale(3.0); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); EXPECT_EQ(3.0, GetFullScreenMagnifierScale()); // Logs in (but the session is not started yet). @@ -295,14 +295,14 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToFull) { // Confirms that magnifier is keeping enabled. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); user_manager::UserManager::Get()->SessionStarted(); // Confirms that the magnifier is enabled and configured according to the // explicitly set prefs just after session start. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); } @@ -314,10 +314,10 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, PRE_LoginFullToUnset) { IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToUnset) { // Enables full screen magnifier. - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); SetMagnifierEnabled(true); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); // Logs in (but the session is not started yet). user_manager::UserManager::Get()->UserLoggedIn( @@ -325,7 +325,7 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginFullToUnset) { // Confirms that magnifier is keeping enabled. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); user_manager::UserManager::Get()->SessionStarted(); @@ -357,11 +357,11 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserOff) { IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserFull) { // Enables magnifier on login screen. - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); SetMagnifierEnabled(true); SetFullScreenMagnifierScale(2.5); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); // Logs in (but the session is not started yet). @@ -370,13 +370,13 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserFull) { // Confirms that magnifier is keeping enabled. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); user_manager::UserManager::Get()->SessionStarted(); // Confirms that magnifier keeps enabled. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); EXPECT_TRUE(GetScreenMagnifierEnabledFromPref()); } @@ -402,58 +402,58 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, LoginAsNewUserUnset) { IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, ChangeMagnifierType) { // Enables/disables full screen magnifier. SetMagnifierEnabled(false); - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); EXPECT_FALSE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); SetMagnifierEnabled(true); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); SetMagnifierEnabled(false); EXPECT_FALSE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); // Enables/disables partial screen magnifier. - SetMagnifierType(ash::MAGNIFIER_PARTIAL); + SetMagnifierType(ui::MAGNIFIER_PARTIAL); EXPECT_FALSE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); SetMagnifierEnabled(true); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); SetMagnifierEnabled(false); EXPECT_FALSE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); // Changes the magnifier type when the magnifier is enabled. - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); SetMagnifierEnabled(true); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); - SetMagnifierType(ash::MAGNIFIER_PARTIAL); + SetMagnifierType(ui::MAGNIFIER_PARTIAL); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); // Changes the magnifier type when the magnifier is disabled. SetMagnifierEnabled(false); - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); EXPECT_FALSE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); - SetMagnifierType(ash::MAGNIFIER_PARTIAL); + SetMagnifierType(ui::MAGNIFIER_PARTIAL); EXPECT_FALSE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); EXPECT_FALSE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); } IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, TypePref) { @@ -466,11 +466,11 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, TypePref) { EXPECT_FALSE(IsMagnifierEnabled()); // Sets the pref as true to enable magnifier. - SetScreenMagnifierTypePref(ash::MAGNIFIER_FULL); + SetScreenMagnifierTypePref(ui::MAGNIFIER_FULL); SetScreenMagnifierEnabledPref(true); // Confirms that magnifier is enabled. EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); } IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, ScalePref) { @@ -481,10 +481,10 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, ScalePref) { SetSavedFullScreenMagnifierScale(2.5); // Enables full screen magnifier. - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); SetMagnifierEnabled(true); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); // Confirms that 2.5x is restored. EXPECT_EQ(2.5, GetFullScreenMagnifierScale()); @@ -503,10 +503,10 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, InvalidScalePref) { SetSavedFullScreenMagnifierScale(0.5); // Enables full screen magnifier. - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); SetMagnifierEnabled(true); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); // Confirms that the actual scale is set to the minimum scale. EXPECT_EQ(1.0, GetFullScreenMagnifierScale()); @@ -521,7 +521,7 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, InvalidScalePref) { // Enables full screen magnifier. SetMagnifierEnabled(true); EXPECT_TRUE(IsMagnifierEnabled()); - EXPECT_EQ(ash::MAGNIFIER_FULL, GetMagnifierType()); + EXPECT_EQ(ui::MAGNIFIER_FULL, GetMagnifierType()); // Confirms that the actual scale is set to the maximum scale. EXPECT_EQ(4.0, GetFullScreenMagnifierScale()); @@ -535,17 +535,17 @@ IN_PROC_BROWSER_TEST_F(MagnificationManagerTest, // Set full screen magnifier, and confirm the observer is called. SetMagnifierEnabled(true); - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); EXPECT_TRUE(observer.observed()); EXPECT_TRUE(observer.observed_enabled()); - EXPECT_EQ(observer.magnifier_type(), ash::MAGNIFIER_FULL); - EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); + EXPECT_EQ(observer.magnifier_type(), ui::MAGNIFIER_FULL); + EXPECT_EQ(GetMagnifierType(), ui::MAGNIFIER_FULL); observer.reset(); // Set full screen magnifier again, and confirm the observer is not called. - SetMagnifierType(ash::MAGNIFIER_FULL); + SetMagnifierType(ui::MAGNIFIER_FULL); EXPECT_FALSE(observer.observed()); - EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); + EXPECT_EQ(GetMagnifierType(), ui::MAGNIFIER_FULL); observer.reset(); }