OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/login/lock/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "ash/common/wm/window_state.h" | 9 #include "ash/common/wm/window_state.h" |
10 #include "ash/wm/window_state_aura.h" | 10 #include "ash/wm/window_state_aura.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 ash::wm::WindowState* window_state = ash::wm::GetWindowState( | 196 ash::wm::WindowState* window_state = ash::wm::GetWindowState( |
197 browser_window->GetNativeWindow()); | 197 browser_window->GetNativeWindow()); |
198 { | 198 { |
199 Waiter waiter(browser()); | 199 Waiter waiter(browser()); |
200 browser() | 200 browser() |
201 ->exclusive_access_manager() | 201 ->exclusive_access_manager() |
202 ->fullscreen_controller() | 202 ->fullscreen_controller() |
203 ->ToggleBrowserFullscreenMode(); | 203 ->ToggleBrowserFullscreenMode(); |
204 waiter.Wait(false /* not locked */, true /* full screen */); | 204 waiter.Wait(false /* not locked */, true /* full screen */); |
205 EXPECT_TRUE(browser_window->IsFullscreen()); | 205 EXPECT_TRUE(browser_window->IsFullscreen()); |
206 EXPECT_FALSE(window_state->hide_shelf_when_fullscreen()); | 206 EXPECT_NE(ash::wm::WindowState::SHELF_HIDDEN, |
| 207 window_state->shelf_mode_in_fullscreen()); |
207 EXPECT_FALSE(tester->IsLocked()); | 208 EXPECT_FALSE(tester->IsLocked()); |
208 } | 209 } |
209 { | 210 { |
210 Waiter waiter(browser()); | 211 Waiter waiter(browser()); |
211 ScreenLocker::Show(); | 212 ScreenLocker::Show(); |
212 tester->EmulateWindowManagerReady(); | 213 tester->EmulateWindowManagerReady(); |
213 waiter.Wait(true /* locked */, true /* full screen */); | 214 waiter.Wait(true /* locked */, true /* full screen */); |
214 EXPECT_TRUE(browser_window->IsFullscreen()); | 215 EXPECT_TRUE(browser_window->IsFullscreen()); |
215 EXPECT_FALSE(window_state->hide_shelf_when_fullscreen()); | 216 EXPECT_NE(ash::wm::WindowState::SHELF_HIDDEN, |
| 217 window_state->shelf_mode_in_fullscreen()); |
216 EXPECT_TRUE(tester->IsLocked()); | 218 EXPECT_TRUE(tester->IsLocked()); |
217 } | 219 } |
218 UserContext user_context(login::StubAccountId()); | 220 UserContext user_context(login::StubAccountId()); |
219 user_context.SetKey(Key("pass")); | 221 user_context.SetKey(Key("pass")); |
220 tester->InjectStubUserContext(user_context); | 222 tester->InjectStubUserContext(user_context); |
221 tester->EnterPassword("pass"); | 223 tester->EnterPassword("pass"); |
222 content::RunAllPendingInMessageLoop(); | 224 content::RunAllPendingInMessageLoop(); |
223 EXPECT_FALSE(tester->IsLocked()); | 225 EXPECT_FALSE(tester->IsLocked()); |
224 { | 226 { |
225 Waiter waiter(browser()); | 227 Waiter waiter(browser()); |
(...skipping 11 matching lines...) Expand all Loading... |
237 { | 239 { |
238 Waiter waiter(browser()); | 240 Waiter waiter(browser()); |
239 content::WebContents* web_contents = | 241 content::WebContents* web_contents = |
240 browser()->tab_strip_model()->GetActiveWebContents(); | 242 browser()->tab_strip_model()->GetActiveWebContents(); |
241 browser() | 243 browser() |
242 ->exclusive_access_manager() | 244 ->exclusive_access_manager() |
243 ->fullscreen_controller() | 245 ->fullscreen_controller() |
244 ->EnterFullscreenModeForTab(web_contents, GURL()); | 246 ->EnterFullscreenModeForTab(web_contents, GURL()); |
245 waiter.Wait(false /* not locked */, true /* fullscreen */); | 247 waiter.Wait(false /* not locked */, true /* fullscreen */); |
246 EXPECT_TRUE(browser_window->IsFullscreen()); | 248 EXPECT_TRUE(browser_window->IsFullscreen()); |
247 EXPECT_TRUE(window_state->hide_shelf_when_fullscreen()); | 249 EXPECT_EQ(ash::wm::WindowState::SHELF_HIDDEN, |
| 250 window_state->shelf_mode_in_fullscreen()); |
248 EXPECT_FALSE(tester->IsLocked()); | 251 EXPECT_FALSE(tester->IsLocked()); |
249 } | 252 } |
250 { | 253 { |
251 Waiter waiter(browser()); | 254 Waiter waiter(browser()); |
252 ScreenLocker::Show(); | 255 ScreenLocker::Show(); |
253 tester->EmulateWindowManagerReady(); | 256 tester->EmulateWindowManagerReady(); |
254 waiter.Wait(true /* locked */, false /* full screen */); | 257 waiter.Wait(true /* locked */, false /* full screen */); |
255 EXPECT_FALSE(browser_window->IsFullscreen()); | 258 EXPECT_FALSE(browser_window->IsFullscreen()); |
256 EXPECT_TRUE(tester->IsLocked()); | 259 EXPECT_TRUE(tester->IsLocked()); |
257 } | 260 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 EXPECT_EQ("", tester->GetPassword()); | 317 EXPECT_EQ("", tester->GetPassword()); |
315 | 318 |
316 // Close the locker to match expectations. | 319 // Close the locker to match expectations. |
317 ScreenLocker::Hide(); | 320 ScreenLocker::Hide(); |
318 content::RunAllPendingInMessageLoop(); | 321 content::RunAllPendingInMessageLoop(); |
319 EXPECT_FALSE(tester->IsLocked()); | 322 EXPECT_FALSE(tester->IsLocked()); |
320 EXPECT_TRUE(VerifyLockScreenDismissed()); | 323 EXPECT_TRUE(VerifyLockScreenDismissed()); |
321 } | 324 } |
322 | 325 |
323 } // namespace chromeos | 326 } // namespace chromeos |
OLD | NEW |