| OLD | NEW |
| 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/wm_shelf.h" | 8 #include "ash/shelf/wm_shelf.h" |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace test { | 12 namespace { |
| 13 | 13 |
| 14 // Tests the shelf behavior when the screen or session is locked. | 14 // Tests the shelf behavior when the screen or session is locked. |
| 15 class ShelfLockingManagerTest : public ash::test::AshTestBase { | 15 class ShelfLockingManagerTest : public test::AshTestBase { |
| 16 public: | 16 public: |
| 17 ShelfLockingManagerTest() {} | 17 ShelfLockingManagerTest() {} |
| 18 | 18 |
| 19 ShelfLockingManager* GetShelfLockingManager() { | 19 ShelfLockingManager* GetShelfLockingManager() { |
| 20 return GetPrimaryShelf()->GetShelfLockingManagerForTesting(); | 20 return GetPrimaryShelf()->GetShelfLockingManagerForTesting(); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void SetScreenLocked(bool locked) { | 23 void SetScreenLocked(bool locked) { |
| 24 GetShelfLockingManager()->OnLockStateChanged(locked); | 24 GetShelfLockingManager()->OnLockStateChanged(locked); |
| 25 } | 25 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->GetAlignment()); | 71 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM, shelf->GetAlignment()); |
| 72 | 72 |
| 73 SetScreenLocked(true); | 73 SetScreenLocked(true); |
| 74 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment()); | 74 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment()); |
| 75 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); | 75 shelf->SetAlignment(SHELF_ALIGNMENT_RIGHT); |
| 76 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment()); | 76 EXPECT_EQ(SHELF_ALIGNMENT_BOTTOM_LOCKED, shelf->GetAlignment()); |
| 77 SetScreenLocked(false); | 77 SetScreenLocked(false); |
| 78 EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->GetAlignment()); | 78 EXPECT_EQ(SHELF_ALIGNMENT_RIGHT, shelf->GetAlignment()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace test | 81 } // namespace |
| 82 } // namespace ash | 82 } // namespace ash |
| OLD | NEW |