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

Side by Side Diff: ash/shelf/shelf_locking_manager_unittest.cc

Issue 1914093002: Refactors DockedWindowLayoutManager in terms of ash/wm/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nuke_aura_window
Patch Set: comment Created 4 years, 8 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
« no previous file with comments | « ash/shelf/shelf_locking_manager.cc ('k') | ash/shelf/shelf_types.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/shelf/shelf_locking_manager.h" 5 #include "ash/shelf/shelf_locking_manager.h"
6 6
7 #include "ash/session/session_state_delegate.h" 7 #include "ash/session/session_state_delegate.h"
8 #include "ash/shelf/shelf.h" 8 #include "ash/shelf/shelf.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/test/shelf_test_api.h" 10 #include "ash/test/shelf_test_api.h"
(...skipping 18 matching lines...) Expand all
29 GetShelfLockingManager()->SessionStateChanged(state); 29 GetShelfLockingManager()->SessionStateChanged(state);
30 } 30 }
31 31
32 private: 32 private:
33 DISALLOW_COPY_AND_ASSIGN(ShelfLockingManagerTest); 33 DISALLOW_COPY_AND_ASSIGN(ShelfLockingManagerTest);
34 }; 34 };
35 35
36 // Makes sure shelf alignment is correct for lock screen. 36 // Makes sure shelf alignment is correct for lock screen.
37 TEST_F(ShelfLockingManagerTest, AlignmentLockedWhileScreenLocked) { 37 TEST_F(ShelfLockingManagerTest, AlignmentLockedWhileScreenLocked) {
38 Shelf* shelf = Shelf::ForPrimaryDisplay(); 38 Shelf* shelf = Shelf::ForPrimaryDisplay();
39 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->alignment()); 39 EXPECT_EQ(wm::SHELF_ALIGNMENT_BOTTOM, shelf->alignment());
40 40
41 shelf->SetAlignment(SHELF_ALIGNMENT_LEFT); 41 shelf->SetAlignment(wm::SHELF_ALIGNMENT_LEFT);
42 EXPECT_EQ(SHELF_ALIGNMENT_LEFT, shelf->alignment()); 42 EXPECT_EQ(wm::SHELF_ALIGNMENT_LEFT, shelf->alignment());
43 43
44 SetScreenLocked(true); 44 SetScreenLocked(true);
45 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment()); 45 EXPECT_EQ(wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment());
46 SetScreenLocked(false); 46 SetScreenLocked(false);
47 EXPECT_EQ(SHELF_ALIGNMENT_LEFT, shelf->alignment()); 47 EXPECT_EQ(wm::SHELF_ALIGNMENT_LEFT, shelf->alignment());
48 } 48 }
49 49
50 // Makes sure shelf alignment is correct for login and add user screens. 50 // Makes sure shelf alignment is correct for login and add user screens.
51 TEST_F(ShelfLockingManagerTest, AlignmentLockedWhileSessionLocked) { 51 TEST_F(ShelfLockingManagerTest, AlignmentLockedWhileSessionLocked) {
52 Shelf* shelf = Shelf::ForPrimaryDisplay(); 52 Shelf* shelf = Shelf::ForPrimaryDisplay();
53 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->alignment()); 53 EXPECT_EQ(wm::SHELF_ALIGNMENT_BOTTOM, shelf->alignment());
54 54
55 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); 55 shelf->SetAlignment(wm::SHELF_ALIGNMENT_RIGHT);
56 EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->alignment()); 56 EXPECT_EQ(wm::SHELF_ALIGNMENT_RIGHT, shelf->alignment());
57 57
58 SetSessionState(SessionStateDelegate::SESSION_STATE_LOGIN_PRIMARY); 58 SetSessionState(SessionStateDelegate::SESSION_STATE_LOGIN_PRIMARY);
59 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment()); 59 EXPECT_EQ(wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment());
60 SetSessionState(SessionStateDelegate::SESSION_STATE_ACTIVE); 60 SetSessionState(SessionStateDelegate::SESSION_STATE_ACTIVE);
61 EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->alignment()); 61 EXPECT_EQ(wm::SHELF_ALIGNMENT_RIGHT, shelf->alignment());
62 62
63 SetSessionState(SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY); 63 SetSessionState(SessionStateDelegate::SESSION_STATE_LOGIN_SECONDARY);
64 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment()); 64 EXPECT_EQ(wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment());
65 SetSessionState(SessionStateDelegate::SESSION_STATE_ACTIVE); 65 SetSessionState(SessionStateDelegate::SESSION_STATE_ACTIVE);
66 EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->alignment()); 66 EXPECT_EQ(wm::SHELF_ALIGNMENT_RIGHT, shelf->alignment());
67 } 67 }
68 68
69 // Makes sure shelf alignment changes are stored, not set, while locked. 69 // Makes sure shelf alignment changes are stored, not set, while locked.
70 TEST_F(ShelfLockingManagerTest, AlignmentChangesDeferredWhileLocked) { 70 TEST_F(ShelfLockingManagerTest, AlignmentChangesDeferredWhileLocked) {
71 Shelf* shelf = Shelf::ForPrimaryDisplay(); 71 Shelf* shelf = Shelf::ForPrimaryDisplay();
72 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->alignment()); 72 EXPECT_EQ(wm::SHELF_ALIGNMENT_BOTTOM, shelf->alignment());
73 73
74 SetScreenLocked(true); 74 SetScreenLocked(true);
75 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment()); 75 EXPECT_EQ(wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment());
76 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); 76 shelf->SetAlignment(wm::SHELF_ALIGNMENT_RIGHT);
77 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment()); 77 EXPECT_EQ(wm::SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->alignment());
78 SetScreenLocked(false); 78 SetScreenLocked(false);
79 EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->alignment()); 79 EXPECT_EQ(wm::SHELF_ALIGNMENT_RIGHT, shelf->alignment());
80 } 80 }
81 81
82 } // namespace test 82 } // namespace test
83 } // namespace ash 83 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_locking_manager.cc ('k') | ash/shelf/shelf_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698