OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/login/lock_screen_controller.h" | 5 #include "ash/login/lock_screen_controller.h" |
6 | 6 |
7 #include "ash/login/mock_lock_screen_client.h" | 7 #include "ash/login/mock_lock_screen_client.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 EXPECT_CALL(*client, HardlockPod(id)); | 60 EXPECT_CALL(*client, HardlockPod(id)); |
61 controller->HardlockPod(id); | 61 controller->HardlockPod(id); |
62 base::RunLoop().RunUntilIdle(); | 62 base::RunLoop().RunUntilIdle(); |
63 | 63 |
64 // Verify RecordClickOnLockIcon mojo call is run with the same account id. | 64 // Verify RecordClickOnLockIcon mojo call is run with the same account id. |
65 EXPECT_CALL(*client, RecordClickOnLockIcon(id)); | 65 EXPECT_CALL(*client, RecordClickOnLockIcon(id)); |
66 controller->RecordClickOnLockIcon(id); | 66 controller->RecordClickOnLockIcon(id); |
67 base::RunLoop().RunUntilIdle(); | 67 base::RunLoop().RunUntilIdle(); |
68 } | 68 } |
69 | 69 |
| 70 TEST_F(LockScreenControllerTest, RequestUserPodFocus) { |
| 71 LockScreenController* controller = Shell::Get()->lock_screen_controller(); |
| 72 std::unique_ptr<MockLockScreenClient> client = BindMockLockScreenClient(); |
| 73 |
| 74 AccountId id = AccountId::FromUserEmail("user1@test.com"); |
| 75 |
| 76 // Verify FocusPod mojo call is run with the same account id. |
| 77 EXPECT_CALL(*client, OnFocusPod(id)); |
| 78 controller->OnFocusPod(id); |
| 79 base::RunLoop().RunUntilIdle(); |
| 80 |
| 81 // Verify NoPodFocused mojo call is run. |
| 82 EXPECT_CALL(*client, OnNoPodFocused()); |
| 83 controller->OnNoPodFocused(); |
| 84 base::RunLoop().RunUntilIdle(); |
| 85 } |
| 86 |
70 } // namespace | 87 } // namespace |
71 } // namespace ash | 88 } // namespace ash |
OLD | NEW |