| Index: chrome/browser/chromeos/login/login_browsertest.cc
|
| diff --git a/chrome/browser/chromeos/login/login_browsertest.cc b/chrome/browser/chromeos/login/login_browsertest.cc
|
| index 25f1b36f67d88c21f9f2148562946577bd6b82c7..3ae35e88f9041e3865d010d889998a827504e210 100644
|
| --- a/chrome/browser/chromeos/login/login_browsertest.cc
|
| +++ b/chrome/browser/chromeos/login/login_browsertest.cc
|
| @@ -2,10 +2,14 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +#include "ash/shell.h"
|
| +#include "ash/wm/cursor_manager.h"
|
| #include "base/command_line.h"
|
| #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h"
|
| #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h"
|
| #include "chrome/browser/chromeos/cros/mock_network_library.h"
|
| +#include "chrome/browser/chromeos/login/login_wizard.h"
|
| +#include "chrome/browser/chromeos/login/wizard_controller.h"
|
| #include "chrome/browser/profiles/profile_manager.h"
|
| #include "chrome/browser/ui/browser.h"
|
| #include "chrome/common/chrome_switches.h"
|
| @@ -74,6 +78,13 @@ class LoginGuestTest : public LoginTestBase {
|
| }
|
| };
|
|
|
| +class LoginCursorTest : public LoginTestBase {
|
| + protected:
|
| + virtual void SetUpCommandLine(CommandLine* command_line) {
|
| + command_line->AppendSwitch(switches::kLoginManager);
|
| + }
|
| +};
|
| +
|
| // After a chrome crash, the session manager will restart chrome with
|
| // the -login-user flag indicating that the user is already logged in.
|
| // This profile should NOT be an OTR profile.
|
| @@ -83,6 +94,11 @@ IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) {
|
| EXPECT_FALSE(profile->IsOffTheRecord());
|
| }
|
|
|
| +// Verifies the cursor is not hidden at startup when user is logged in.
|
| +IN_PROC_BROWSER_TEST_F(LoginUserTest, CursorShown) {
|
| + EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible());
|
| +}
|
| +
|
| // After a guest login, we should get the OTR default profile.
|
| IN_PROC_BROWSER_TEST_F(LoginGuestTest, GuestIsOTR) {
|
| Profile* profile = browser()->profile();
|
| @@ -92,4 +108,22 @@ IN_PROC_BROWSER_TEST_F(LoginGuestTest, GuestIsOTR) {
|
| EXPECT_TRUE(profile->GetExtensionService());
|
| }
|
|
|
| +// Verifies the cursor is not hidden at startup when running guest session.
|
| +IN_PROC_BROWSER_TEST_F(LoginGuestTest, CursorShown) {
|
| + EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible());
|
| +}
|
| +
|
| +// Verifies the cursor is hidden at startup on login screen.
|
| +IN_PROC_BROWSER_TEST_F(LoginCursorTest, CursorHidden) {
|
| + // Login screen needs to be shown explicitly when running test.
|
| + ShowLoginWizard(WizardController::kLoginScreenName, gfx::Size());
|
| +
|
| + // Cursor should be hidden at startup
|
| + EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible());
|
| +
|
| + // Cursor should be shown after cursor is moved.
|
| + EXPECT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point()));
|
| + EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible());
|
| +}
|
| +
|
| } // namespace chromeos
|
|
|