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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.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_network_library.h" | |
10 #include "chrome/browser/chromeos/login/mock_authenticator.h" | 9 #include "chrome/browser/chromeos/login/mock_authenticator.h" |
11 #include "chrome/browser/chromeos/login/screen_locker.h" | 10 #include "chrome/browser/chromeos/login/screen_locker.h" |
12 #include "chrome/browser/chromeos/login/screen_locker_tester.h" | 11 #include "chrome/browser/chromeos/login/screen_locker_tester.h" |
13 #include "chrome/browser/chromeos/login/user_manager.h" | 12 #include "chrome/browser/chromeos/login/user_manager.h" |
14 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
17 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | 16 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" |
18 #include "chrome/common/chrome_notification_types.h" | 17 #include "chrome/common/chrome_notification_types.h" |
19 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 117 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
119 MockDBusThreadManagerWithoutGMock* mock_dbus_thread_manager = | 118 MockDBusThreadManagerWithoutGMock* mock_dbus_thread_manager = |
120 new MockDBusThreadManagerWithoutGMock; | 119 new MockDBusThreadManagerWithoutGMock; |
121 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager); | 120 DBusThreadManager::InitializeForTesting(mock_dbus_thread_manager); |
122 CrosInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 121 CrosInProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
123 fake_session_manager_client_ = | 122 fake_session_manager_client_ = |
124 mock_dbus_thread_manager->fake_session_manager_client(); | 123 mock_dbus_thread_manager->fake_session_manager_client(); |
125 cros_mock_->InitStatusAreaMocks(); | 124 cros_mock_->InitStatusAreaMocks(); |
126 // Expectations for the status are on the screen lock window. | 125 // Expectations for the status are on the screen lock window. |
127 cros_mock_->SetStatusAreaMocksExpectations(); | 126 cros_mock_->SetStatusAreaMocksExpectations(); |
128 MockNetworkLibrary* mock_network_library = | |
129 cros_mock_->mock_network_library(); | |
130 EXPECT_CALL(*mock_network_library, AddUserActionObserver(_)) | |
131 .Times(AnyNumber()); | |
132 EXPECT_CALL(*mock_network_library, LoadOncNetworks(_, _)) | |
133 .Times(AnyNumber()); | |
134 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( | 127 zero_duration_mode_.reset(new ui::ScopedAnimationDurationScaleMode( |
135 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); | 128 ui::ScopedAnimationDurationScaleMode::ZERO_DURATION)); |
136 } | 129 } |
137 | 130 |
138 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 131 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
139 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); | 132 command_line->AppendSwitchASCII(switches::kLoginProfile, "user"); |
140 } | 133 } |
141 | 134 |
142 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; | 135 scoped_ptr<ui::ScopedAnimationDurationScaleMode> zero_duration_mode_; |
143 | 136 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 EXPECT_EQ("", tester->GetPassword()); | 257 EXPECT_EQ("", tester->GetPassword()); |
265 | 258 |
266 // Close the locker to match expectations. | 259 // Close the locker to match expectations. |
267 ScreenLocker::Hide(); | 260 ScreenLocker::Hide(); |
268 content::RunAllPendingInMessageLoop(); | 261 content::RunAllPendingInMessageLoop(); |
269 EXPECT_FALSE(tester->IsLocked()); | 262 EXPECT_FALSE(tester->IsLocked()); |
270 EXPECT_TRUE(VerifyLockScreenDismissed()); | 263 EXPECT_TRUE(VerifyLockScreenDismissed()); |
271 } | 264 } |
272 | 265 |
273 } // namespace chromeos | 266 } // namespace chromeos |
OLD | NEW |