| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shell.h" | 5 #include "ash/shell.h" |
| 6 #include "ash/wm/cursor_manager.h" | 6 #include "ash/wm/cursor_manager.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" | 8 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" |
| 9 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" | 9 #include "chrome/browser/chromeos/cros/mock_cryptohome_library.h" |
| 10 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 10 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // the -login-user flag indicating that the user is already logged in. | 92 // the -login-user flag indicating that the user is already logged in. |
| 93 // This profile should NOT be an OTR profile. | 93 // This profile should NOT be an OTR profile. |
| 94 IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) { | 94 IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) { |
| 95 Profile* profile = browser()->profile(); | 95 Profile* profile = browser()->profile(); |
| 96 EXPECT_EQ("user", profile->GetPath().BaseName().value()); | 96 EXPECT_EQ("user", profile->GetPath().BaseName().value()); |
| 97 EXPECT_FALSE(profile->IsOffTheRecord()); | 97 EXPECT_FALSE(profile->IsOffTheRecord()); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Verifies the cursor is not hidden at startup when user is logged in. | 100 // Verifies the cursor is not hidden at startup when user is logged in. |
| 101 IN_PROC_BROWSER_TEST_F(LoginUserTest, CursorShown) { | 101 IN_PROC_BROWSER_TEST_F(LoginUserTest, CursorShown) { |
| 102 EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible()); | 102 EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible()); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // After a guest login, we should get the OTR default profile. | 105 // After a guest login, we should get the OTR default profile. |
| 106 IN_PROC_BROWSER_TEST_F(LoginGuestTest, GuestIsOTR) { | 106 IN_PROC_BROWSER_TEST_F(LoginGuestTest, GuestIsOTR) { |
| 107 Profile* profile = browser()->profile(); | 107 Profile* profile = browser()->profile(); |
| 108 EXPECT_EQ("Default", profile->GetPath().BaseName().value()); | 108 EXPECT_EQ("Default", profile->GetPath().BaseName().value()); |
| 109 EXPECT_TRUE(profile->IsOffTheRecord()); | 109 EXPECT_TRUE(profile->IsOffTheRecord()); |
| 110 // Ensure there's extension service for this profile. | 110 // Ensure there's extension service for this profile. |
| 111 EXPECT_TRUE(extensions::ExtensionSystem::Get(profile)->extension_service()); | 111 EXPECT_TRUE(extensions::ExtensionSystem::Get(profile)->extension_service()); |
| 112 } | 112 } |
| 113 | 113 |
| 114 // Verifies the cursor is not hidden at startup when running guest session. | 114 // Verifies the cursor is not hidden at startup when running guest session. |
| 115 IN_PROC_BROWSER_TEST_F(LoginGuestTest, CursorShown) { | 115 IN_PROC_BROWSER_TEST_F(LoginGuestTest, CursorShown) { |
| 116 EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible()); | 116 EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible()); |
| 117 } | 117 } |
| 118 | 118 |
| 119 // Verifies the cursor is hidden at startup on login screen. | 119 // Verifies the cursor is hidden at startup on login screen. |
| 120 IN_PROC_BROWSER_TEST_F(LoginCursorTest, CursorHidden) { | 120 IN_PROC_BROWSER_TEST_F(LoginCursorTest, CursorHidden) { |
| 121 // Login screen needs to be shown explicitly when running test. | 121 // Login screen needs to be shown explicitly when running test. |
| 122 ShowLoginWizard(WizardController::kLoginScreenName, gfx::Size()); | 122 ShowLoginWizard(WizardController::kLoginScreenName, gfx::Size()); |
| 123 | 123 |
| 124 // Cursor should be hidden at startup | 124 // Cursor should be hidden at startup |
| 125 EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible()); | 125 EXPECT_FALSE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible()); |
| 126 | 126 |
| 127 // Cursor should be shown after cursor is moved. | 127 // Cursor should be shown after cursor is moved. |
| 128 EXPECT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point())); | 128 EXPECT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point())); |
| 129 EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->cursor_visible()); | 129 EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible()); |
| 130 | 130 |
| 131 MessageLoop::current()->DeleteSoon(FROM_HERE, | 131 MessageLoop::current()->DeleteSoon(FROM_HERE, |
| 132 BaseLoginDisplayHost::default_host()); | 132 BaseLoginDisplayHost::default_host()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace chromeos | 135 } // namespace chromeos |
| OLD | NEW |