| 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 <utility> |
| 8 |
| 7 #include "base/macros.h" | 9 #include "base/macros.h" |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/test/test_simple_task_runner.h" | 12 #include "base/test/test_simple_task_runner.h" |
| 11 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
| 12 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 13 #include "components/proximity_auth/fake_secure_context.h" | 15 #include "components/proximity_auth/fake_secure_context.h" |
| 14 #include "components/proximity_auth/logging/logging.h" | 16 #include "components/proximity_auth/logging/logging.h" |
| 15 #include "components/proximity_auth/messenger.h" | 17 #include "components/proximity_auth/messenger.h" |
| 16 #include "components/proximity_auth/mock_proximity_auth_client.h" | 18 #include "components/proximity_auth/mock_proximity_auth_client.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 157 |
| 156 MockProximityMonitor* proximity_monitor() { return proximity_monitor_; } | 158 MockProximityMonitor* proximity_monitor() { return proximity_monitor_; } |
| 157 | 159 |
| 158 private: | 160 private: |
| 159 scoped_ptr<ProximityMonitor> CreateProximityMonitor( | 161 scoped_ptr<ProximityMonitor> CreateProximityMonitor( |
| 160 const RemoteDevice& remote_device) override { | 162 const RemoteDevice& remote_device) override { |
| 161 EXPECT_EQ(kTestRemoteDevicePublicKey, remote_device.public_key); | 163 EXPECT_EQ(kTestRemoteDevicePublicKey, remote_device.public_key); |
| 162 scoped_ptr<MockProximityMonitor> proximity_monitor( | 164 scoped_ptr<MockProximityMonitor> proximity_monitor( |
| 163 new NiceMock<MockProximityMonitor>()); | 165 new NiceMock<MockProximityMonitor>()); |
| 164 proximity_monitor_ = proximity_monitor.get(); | 166 proximity_monitor_ = proximity_monitor.get(); |
| 165 return proximity_monitor.Pass(); | 167 return std::move(proximity_monitor); |
| 166 } | 168 } |
| 167 | 169 |
| 168 // Owned by the super class. | 170 // Owned by the super class. |
| 169 MockProximityMonitor* proximity_monitor_; | 171 MockProximityMonitor* proximity_monitor_; |
| 170 | 172 |
| 171 DISALLOW_COPY_AND_ASSIGN(TestUnlockManager); | 173 DISALLOW_COPY_AND_ASSIGN(TestUnlockManager); |
| 172 }; | 174 }; |
| 173 | 175 |
| 174 // Creates a mock Bluetooth adapter and sets it as the global adapter for | 176 // Creates a mock Bluetooth adapter and sets it as the global adapter for |
| 175 // testing. | 177 // testing. |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 })); | 924 })); |
| 923 | 925 |
| 924 EXPECT_CALL(messenger_, RequestDecryption(kChallenge)); | 926 EXPECT_CALL(messenger_, RequestDecryption(kChallenge)); |
| 925 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); | 927 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); |
| 926 | 928 |
| 927 EXPECT_CALL(proximity_auth_client_, FinalizeSignin(std::string())); | 929 EXPECT_CALL(proximity_auth_client_, FinalizeSignin(std::string())); |
| 928 unlock_manager_->OnDecryptResponse(std::string()); | 930 unlock_manager_->OnDecryptResponse(std::string()); |
| 929 } | 931 } |
| 930 | 932 |
| 931 } // namespace proximity_auth | 933 } // namespace proximity_auth |
| OLD | NEW |