| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" | 4 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" |
| 5 | 5 |
| 6 #include "base/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/single_thread_task_runner.h" | 8 #include "base/single_thread_task_runner.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/test/histogram_tester.h" | 10 #include "base/test/histogram_tester.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 RequestOutcome* reason) override { | 111 RequestOutcome* reason) override { |
| 112 return true; | 112 return true; |
| 113 } | 113 } |
| 114 | 114 |
| 115 void ShowPhishingInterstitial(const GURL& phishing_url, | 115 void ShowPhishingInterstitial(const GURL& phishing_url, |
| 116 const std::string& token, | 116 const std::string& token, |
| 117 content::WebContents* web_contents) override {} | 117 content::WebContents* web_contents) override {} |
| 118 | 118 |
| 119 bool IsHistorySyncEnabled() override { return false; } | 119 bool IsHistorySyncEnabled() override { return false; } |
| 120 | 120 |
| 121 LoginReputationClientRequest::PasswordReuseEvent::SyncAccountType |
| 122 GetSyncAccountType() override { |
| 123 return LoginReputationClientRequest::PasswordReuseEvent::NOT_SIGNED_IN; |
| 124 } |
| 125 |
| 121 LoginReputationClientResponse* latest_response() { | 126 LoginReputationClientResponse* latest_response() { |
| 122 return latest_response_.get(); | 127 return latest_response_.get(); |
| 123 } | 128 } |
| 124 | 129 |
| 125 ~TestPasswordProtectionService() override {} | 130 ~TestPasswordProtectionService() override {} |
| 126 | 131 |
| 127 size_t GetPendingRequestsCount() { return requests_.size(); } | 132 size_t GetPendingRequestsCount() { return requests_.size(); } |
| 128 | 133 |
| 129 const LoginReputationClientRequest* GetLatestRequestProto() { | 134 const LoginReputationClientRequest* GetLatestRequestProto() { |
| 130 return latest_request_ ? latest_request_->request_proto() : nullptr; | 135 return latest_request_ ? latest_request_->request_proto() : nullptr; |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 828 request_->OnURLFetchComplete(&fetcher); | 833 request_->OnURLFetchComplete(&fetcher); |
| 829 base::RunLoop().RunUntilIdle(); | 834 base::RunLoop().RunUntilIdle(); |
| 830 | 835 |
| 831 actual_request = password_protection_service_->GetLatestRequestProto(); | 836 actual_request = password_protection_service_->GetLatestRequestProto(); |
| 832 ASSERT_TRUE(actual_request->has_password_reuse_event()); | 837 ASSERT_TRUE(actual_request->has_password_reuse_event()); |
| 833 ASSERT_FALSE( | 838 ASSERT_FALSE( |
| 834 actual_request->password_reuse_event().is_chrome_signin_password()); | 839 actual_request->password_reuse_event().is_chrome_signin_password()); |
| 835 } | 840 } |
| 836 | 841 |
| 837 } // namespace safe_browsing | 842 } // namespace safe_browsing |
| OLD | NEW |