| 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/ble/proximity_auth_ble_system.h" | 5 #include "components/proximity_auth/ble/proximity_auth_ble_system.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
| 10 #include "base/test/test_mock_time_task_runner.h" | 10 #include "base/test/test_mock_time_task_runner.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 const char kTestUser[] = "example@gmail.com"; | 64 const char kTestUser[] = "example@gmail.com"; |
| 65 | 65 |
| 66 class MockProximityAuthClient : public ProximityAuthClient { | 66 class MockProximityAuthClient : public ProximityAuthClient { |
| 67 public: | 67 public: |
| 68 MockProximityAuthClient() {} | 68 MockProximityAuthClient() {} |
| 69 ~MockProximityAuthClient() override {} | 69 ~MockProximityAuthClient() override {} |
| 70 | 70 |
| 71 // ProximityAuthClient: | 71 // ProximityAuthClient: |
| 72 std::string GetAuthenticatedUsername() const override { return kTestUser; } | 72 std::string GetAuthenticatedUsername() const override { return kTestUser; } |
| 73 | 73 |
| 74 MOCK_METHOD1(FinalizeUnlock, void(bool)); | 74 MOCK_METHOD1(UpdateScreenlockState, |
| 75 void(proximity_auth::ScreenlockState state)); |
| 76 MOCK_METHOD1(FinalizeUnlock, void(bool success)); |
| 77 MOCK_METHOD1(FinalizeSignin, void(const std::string& secret)); |
| 75 | 78 |
| 76 private: | 79 private: |
| 77 DISALLOW_COPY_AND_ASSIGN(MockProximityAuthClient); | 80 DISALLOW_COPY_AND_ASSIGN(MockProximityAuthClient); |
| 78 }; | 81 }; |
| 79 | 82 |
| 80 } // namespace | 83 } // namespace |
| 81 | 84 |
| 82 class ProximityAuthBleSystemTestable : public ProximityAuthBleSystem { | 85 class ProximityAuthBleSystemTestable : public ProximityAuthBleSystem { |
| 83 public: | 86 public: |
| 84 ProximityAuthBleSystemTestable( | 87 ProximityAuthBleSystemTestable( |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // Show the screen. | 152 // Show the screen. |
| 150 ON_CALL(lock_handler_, GetScreenType()) | 153 ON_CALL(lock_handler_, GetScreenType()) |
| 151 .WillByDefault(Return(ScreenlockBridge::LockHandler::OTHER_SCREEN)); | 154 .WillByDefault(Return(ScreenlockBridge::LockHandler::OTHER_SCREEN)); |
| 152 ScreenlockBridge::Get()->SetLockHandler(&lock_handler_); | 155 ScreenlockBridge::Get()->SetLockHandler(&lock_handler_); |
| 153 | 156 |
| 154 // Hide the screen. | 157 // Hide the screen. |
| 155 ScreenlockBridge::Get()->SetLockHandler(nullptr); | 158 ScreenlockBridge::Get()->SetLockHandler(nullptr); |
| 156 } | 159 } |
| 157 | 160 |
| 158 } // namespace proximity_auth | 161 } // namespace proximity_auth |
| OLD | NEW |