Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(598)

Side by Side Diff: ash/wm/lock_state_controller_unittest.cc

Issue 2391153002: Converts most of WorkspaceLayoutManager tests to use common code (Closed)
Patch Set: merge Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/wm/lock_state_controller.h" 5 #include "ash/wm/lock_state_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" 11 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
12 #include "ash/common/wm_shell.h" 12 #include "ash/common/wm_shell.h"
13 #include "ash/shell.h" 13 #include "ash/shell.h"
14 #include "ash/test/ash_test_base.h" 14 #include "ash/test/ash_test_base.h"
15 #include "ash/test/test_lock_state_controller_delegate.h" 15 #include "ash/test/test_lock_state_controller_delegate.h"
16 #include "ash/test/test_screenshot_delegate.h" 16 #include "ash/test/test_screenshot_delegate.h"
17 #include "ash/test/test_session_state_animator.h" 17 #include "ash/test/test_session_state_animator.h"
18 #include "ash/test/test_session_state_delegate.h"
18 #include "ash/test/test_shell_delegate.h" 19 #include "ash/test/test_shell_delegate.h"
19 #include "ash/wm/power_button_controller.h" 20 #include "ash/wm/power_button_controller.h"
20 #include "ash/wm/session_state_animator.h" 21 #include "ash/wm/session_state_animator.h"
21 #include "base/memory/scoped_vector.h" 22 #include "base/memory/scoped_vector.h"
22 #include "base/time/time.h" 23 #include "base/time/time.h"
23 #include "chromeos/dbus/dbus_thread_manager.h" 24 #include "chromeos/dbus/dbus_thread_manager.h"
24 #include "chromeos/dbus/fake_session_manager_client.h" 25 #include "chromeos/dbus/fake_session_manager_client.h"
25 #include "ui/display/chromeos/display_configurator.h" 26 #include "ui/display/chromeos/display_configurator.h"
26 #include "ui/display/chromeos/test/test_display_snapshot.h" 27 #include "ui/display/chromeos/test/test_display_snapshot.h"
27 #include "ui/display/types/display_constants.h" 28 #include "ui/display/types/display_constants.h"
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 313 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
313 enable); 314 enable);
314 } 315 }
315 316
316 void Initialize(bool legacy_button, LoginStatus status) { 317 void Initialize(bool legacy_button, LoginStatus status) {
317 power_button_controller_->set_has_legacy_power_button_for_test( 318 power_button_controller_->set_has_legacy_power_button_for_test(
318 legacy_button); 319 legacy_button);
319 lock_state_controller_->OnLoginStateChanged(status); 320 lock_state_controller_->OnLoginStateChanged(status);
320 SetUserLoggedIn(status != LoginStatus::NOT_LOGGED_IN); 321 SetUserLoggedIn(status != LoginStatus::NOT_LOGGED_IN);
321 if (status == LoginStatus::GUEST) 322 if (status == LoginStatus::GUEST)
322 SetCanLockScreen(false); 323 TestSessionStateDelegate::SetCanLockScreen(false);
323 lock_state_controller_->OnLockStateChanged(false); 324 lock_state_controller_->OnLockStateChanged(false);
324 } 325 }
325 326
326 PowerButtonController* power_button_controller_; // not owned 327 PowerButtonController* power_button_controller_; // not owned
327 LockStateController* lock_state_controller_; // not owned 328 LockStateController* lock_state_controller_; // not owned
328 TestLockStateControllerDelegate* 329 TestLockStateControllerDelegate*
329 lock_state_controller_delegate_; // not owned 330 lock_state_controller_delegate_; // not owned
330 // Ownership is passed on to chromeos::DBusThreadManager. 331 // Ownership is passed on to chromeos::DBusThreadManager.
331 chromeos::FakeSessionManagerClient* session_manager_client_; 332 chromeos::FakeSessionManagerClient* session_manager_client_;
332 TestSessionStateAnimator* test_animator_; // not owned 333 TestSessionStateAnimator* test_animator_; // not owned
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1087 ReleasePowerButton(); 1088 ReleasePowerButton();
1088 1089
1089 ExpectPreLockAnimationStarted(); 1090 ExpectPreLockAnimationStarted();
1090 1091
1091 test_animator_->CompleteAllAnimations(true); 1092 test_animator_->CompleteAllAnimations(true);
1092 EXPECT_EQ(1, session_manager_client_->request_lock_screen_call_count()); 1093 EXPECT_EQ(1, session_manager_client_->request_lock_screen_call_count());
1093 } 1094 }
1094 1095
1095 } // namespace test 1096 } // namespace test
1096 } // namespace ash 1097 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_session_state_delegate.cc ('k') | ash/wm/workspace/workspace_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698