| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/unlock_manager.h" | 5 #include "components/proximity_auth/unlock_manager.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 ON_CALL(*this, IsInRssiRange()).WillByDefault(Return(false)); | 82 ON_CALL(*this, IsInRssiRange()).WillByDefault(Return(false)); |
| 83 } | 83 } |
| 84 ~MockProximityMonitor() override {} | 84 ~MockProximityMonitor() override {} |
| 85 | 85 |
| 86 MOCK_METHOD0(Start, void()); | 86 MOCK_METHOD0(Start, void()); |
| 87 MOCK_METHOD0(Stop, void()); | 87 MOCK_METHOD0(Stop, void()); |
| 88 MOCK_CONST_METHOD0(GetStrategy, Strategy()); | 88 MOCK_CONST_METHOD0(GetStrategy, Strategy()); |
| 89 MOCK_CONST_METHOD0(IsUnlockAllowed, bool()); | 89 MOCK_CONST_METHOD0(IsUnlockAllowed, bool()); |
| 90 MOCK_CONST_METHOD0(IsInRssiRange, bool()); | 90 MOCK_CONST_METHOD0(IsInRssiRange, bool()); |
| 91 MOCK_METHOD0(RecordProximityMetricsOnAuthSuccess, void()); | 91 MOCK_METHOD0(RecordProximityMetricsOnAuthSuccess, void()); |
| 92 MOCK_METHOD1(AddObserver, void(ProximityMonitorObserver*)); |
| 93 MOCK_METHOD1(RemoveObserver, void(ProximityMonitorObserver*)); |
| 92 | 94 |
| 93 private: | 95 private: |
| 94 DISALLOW_COPY_AND_ASSIGN(MockProximityMonitor); | 96 DISALLOW_COPY_AND_ASSIGN(MockProximityMonitor); |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 class FakeLockHandler : public ScreenlockBridge::LockHandler { | 99 class FakeLockHandler : public ScreenlockBridge::LockHandler { |
| 98 public: | 100 public: |
| 99 FakeLockHandler() {} | 101 FakeLockHandler() {} |
| 100 ~FakeLockHandler() override {} | 102 ~FakeLockHandler() override {} |
| 101 | 103 |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 SimulateUserPresentState(); | 821 SimulateUserPresentState(); |
| 820 | 822 |
| 821 EXPECT_CALL(messenger_, DispatchUnlockEvent()); | 823 EXPECT_CALL(messenger_, DispatchUnlockEvent()); |
| 822 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); | 824 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); |
| 823 | 825 |
| 824 EXPECT_CALL(proximity_auth_client_, FinalizeUnlock(true)); | 826 EXPECT_CALL(proximity_auth_client_, FinalizeUnlock(true)); |
| 825 unlock_manager_->OnUnlockEventSent(true); | 827 unlock_manager_->OnUnlockEventSent(true); |
| 826 } | 828 } |
| 827 | 829 |
| 828 } // namespace proximity_auth | 830 } // namespace proximity_auth |
| OLD | NEW |