| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 class FakeLockHandler : public ScreenlockBridge::LockHandler { | 109 class FakeLockHandler : public ScreenlockBridge::LockHandler { |
| 110 public: | 110 public: |
| 111 FakeLockHandler() {} | 111 FakeLockHandler() {} |
| 112 ~FakeLockHandler() override {} | 112 ~FakeLockHandler() override {} |
| 113 | 113 |
| 114 // LockHandler: | 114 // LockHandler: |
| 115 void ShowBannerMessage(const base::string16& message) override {} | 115 void ShowBannerMessage(const base::string16& message) override {} |
| 116 void ShowUserPodCustomIcon( | 116 void ShowUserPodCustomIcon( |
| 117 const std::string& user_email, | 117 const AccountId& account_id, |
| 118 const ScreenlockBridge::UserPodCustomIconOptions& icon) override {} | 118 const ScreenlockBridge::UserPodCustomIconOptions& icon) override {} |
| 119 void HideUserPodCustomIcon(const std::string& user_email) override {} | 119 void HideUserPodCustomIcon(const AccountId& account_id) override {} |
| 120 void EnableInput() override {} | 120 void EnableInput() override {} |
| 121 void SetAuthType(const std::string& user_email, | 121 void SetAuthType(const AccountId& account_id, |
| 122 AuthType auth_type, | 122 AuthType auth_type, |
| 123 const base::string16& auth_value) override {} | 123 const base::string16& auth_value) override {} |
| 124 AuthType GetAuthType(const std::string& user_email) const override { | 124 AuthType GetAuthType(const AccountId& account_id) const override { |
| 125 return USER_CLICK; | 125 return USER_CLICK; |
| 126 } | 126 } |
| 127 ScreenType GetScreenType() const override { return LOCK_SCREEN; } | 127 ScreenType GetScreenType() const override { return LOCK_SCREEN; } |
| 128 void Unlock(const std::string& user_email) override {} | 128 void Unlock(const AccountId& account_id) override {} |
| 129 void AttemptEasySignin(const std::string& user_email, | 129 void AttemptEasySignin(const AccountId& account_id, |
| 130 const std::string& secret, | 130 const std::string& secret, |
| 131 const std::string& key_label) override {} | 131 const std::string& key_label) override {} |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 DISALLOW_COPY_AND_ASSIGN(FakeLockHandler); | 134 DISALLOW_COPY_AND_ASSIGN(FakeLockHandler); |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 class TestUnlockManager : public UnlockManager { | 137 class TestUnlockManager : public UnlockManager { |
| 138 public: | 138 public: |
| 139 TestUnlockManager(ProximityAuthSystem::ScreenlockType screenlock_type, | 139 TestUnlockManager(ProximityAuthSystem::ScreenlockType screenlock_type, |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 })); | 908 })); |
| 909 | 909 |
| 910 EXPECT_CALL(messenger_, RequestDecryption(kChallenge)); | 910 EXPECT_CALL(messenger_, RequestDecryption(kChallenge)); |
| 911 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); | 911 unlock_manager_->OnAuthAttempted(ScreenlockBridge::LockHandler::USER_CLICK); |
| 912 | 912 |
| 913 EXPECT_CALL(proximity_auth_client_, FinalizeSignin(std::string())); | 913 EXPECT_CALL(proximity_auth_client_, FinalizeSignin(std::string())); |
| 914 unlock_manager_->OnDecryptResponse(std::string()); | 914 unlock_manager_->OnDecryptResponse(std::string()); |
| 915 } | 915 } |
| 916 | 916 |
| 917 } // namespace proximity_auth | 917 } // namespace proximity_auth |
| OLD | NEW |