OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/proximity_auth/proximity_auth_system.h" | 5 #include "components/proximity_auth/proximity_auth_system.h" |
6 | 6 |
7 #include "base/test/simple_test_clock.h" | 7 #include "base/test/simple_test_clock.h" |
8 #include "base/test/test_simple_task_runner.h" | 8 #include "base/test/test_simple_task_runner.h" |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "components/cryptauth/remote_device.h" | 10 #include "components/cryptauth/remote_device.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 // Mock implementation of UnlockManager. | 59 // Mock implementation of UnlockManager. |
60 class MockUnlockManager : public UnlockManager { | 60 class MockUnlockManager : public UnlockManager { |
61 public: | 61 public: |
62 MockUnlockManager() {} | 62 MockUnlockManager() {} |
63 ~MockUnlockManager() override {} | 63 ~MockUnlockManager() override {} |
64 MOCK_METHOD0(IsUnlockAllowed, bool()); | 64 MOCK_METHOD0(IsUnlockAllowed, bool()); |
65 MOCK_METHOD1(SetRemoteDeviceLifeCycle, void(RemoteDeviceLifeCycle*)); | 65 MOCK_METHOD1(SetRemoteDeviceLifeCycle, void(RemoteDeviceLifeCycle*)); |
66 MOCK_METHOD0(OnLifeCycleStateChanged, void()); | 66 MOCK_METHOD0(OnLifeCycleStateChanged, void()); |
67 MOCK_METHOD1(OnAuthAttempted, void(ScreenlockBridge::LockHandler::AuthType)); | 67 MOCK_METHOD1(OnAuthAttempted, void(mojom::AuthType)); |
68 | 68 |
69 private: | 69 private: |
70 DISALLOW_COPY_AND_ASSIGN(MockUnlockManager); | 70 DISALLOW_COPY_AND_ASSIGN(MockUnlockManager); |
71 }; | 71 }; |
72 | 72 |
73 // Mock implementation of ProximityAuthPrefManager. | 73 // Mock implementation of ProximityAuthPrefManager. |
74 class MockProximityAuthPrefManager : public ProximityAuthPrefManager { | 74 class MockProximityAuthPrefManager : public ProximityAuthPrefManager { |
75 public: | 75 public: |
76 MockProximityAuthPrefManager() : ProximityAuthPrefManager(nullptr) {} | 76 MockProximityAuthPrefManager() : ProximityAuthPrefManager(nullptr) {} |
77 ~MockProximityAuthPrefManager() override {} | 77 ~MockProximityAuthPrefManager() override {} |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 TEST_F(ProximityAuthSystemTest, ForcePasswordReauth) { | 429 TEST_F(ProximityAuthSystemTest, ForcePasswordReauth) { |
430 ON_CALL(*pref_manager_, GetLastPasswordEntryTimestampMs()) | 430 ON_CALL(*pref_manager_, GetLastPasswordEntryTimestampMs()) |
431 .WillByDefault(Return(kTimestampAfterReauthMs)); | 431 .WillByDefault(Return(kTimestampAfterReauthMs)); |
432 EXPECT_CALL(proximity_auth_client_, | 432 EXPECT_CALL(proximity_auth_client_, |
433 UpdateScreenlockState(ScreenlockState::PASSWORD_REAUTH)); | 433 UpdateScreenlockState(ScreenlockState::PASSWORD_REAUTH)); |
434 FocusUser(kUser1); | 434 FocusUser(kUser1); |
435 EXPECT_FALSE(life_cycle()); | 435 EXPECT_FALSE(life_cycle()); |
436 } | 436 } |
437 | 437 |
438 } // namespace proximity_auth | 438 } // namespace proximity_auth |
OLD | NEW |