Chromium Code Reviews| Index: components/proximity_auth/proximity_auth_system_unittest.cc |
| diff --git a/components/proximity_auth/proximity_auth_system_unittest.cc b/components/proximity_auth/proximity_auth_system_unittest.cc |
| index 2d878b1ec506882f3d2f26d21f7b821402846377..4ac5bc410e41ef9f4f2d3d24de26cb222a7cba19 100644 |
| --- a/components/proximity_auth/proximity_auth_system_unittest.cc |
| +++ b/components/proximity_auth/proximity_auth_system_unittest.cc |
| @@ -301,6 +301,22 @@ TEST_F(ProximityAuthSystemTest, ToggleFocus_RegisteredAndUnregisteredUsers) { |
| .Times(AtLeast(1)); |
| } |
| +TEST_F(ProximityAuthSystemTest, ToggleFocus_SameUserRefocused) { |
| + RemoteDeviceLifeCycle* life_cycle = nullptr; |
| + EXPECT_CALL(*unlock_manager_, SetRemoteDeviceLifeCycle(_)) |
| + .WillOnce(SaveArg<0>(&life_cycle)); |
| + FocusUser(kUser1); |
| + EXPECT_EQ(kUser1, life_cycle->GetRemoteDevice().user_id); |
| + |
| + // Focusing the user again should be indempotent. The screenlock UI may call |
| + // focus on the same user multiple times. |
| + // SetRemoteDeviceLifeCycle() is only expected to be called once. |
| + FocusUser(kUser1); |
| + |
| + EXPECT_CALL(*unlock_manager_, SetRemoteDeviceLifeCycle(nullptr)) |
|
Ryan Hansberry
2017/05/09 02:51:43
n00b question: I've generally been told that EXPEC
Tim Song
2017/05/10 18:11:16
Ah, this EXPECT_CALL is to catch the call when the
Ryan Hansberry
2017/05/15 15:48:05
Please update the comment "SetRemoteDeviceLifeCycl
Tim Song
2017/05/15 18:30:48
Done.
|
| + .Times(AtLeast(1)); |
| +} |
| + |
| TEST_F(ProximityAuthSystemTest, RestartSystem_UnregisteredUserFocused) { |
| FocusUser(kUser2); |