| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 5 #include <map> |
| 6 #include <queue> | 6 #include <queue> |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 } | 94 } |
| 95 | 95 |
| 96 void SetModelFetchResponse(std::string response_data, bool success) { | 96 void SetModelFetchResponse(std::string response_data, bool success) { |
| 97 factory_->SetFakeResponse(ClientSideDetectionService::kClientModelUrl, | 97 factory_->SetFakeResponse(ClientSideDetectionService::kClientModelUrl, |
| 98 response_data, success); | 98 response_data, success); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void SetClientReportPhishingResponse(std::string response_data, | 101 void SetClientReportPhishingResponse(std::string response_data, |
| 102 bool success) { | 102 bool success) { |
| 103 factory_->SetFakeResponse( | 103 factory_->SetFakeResponse( |
| 104 ClientSideDetectionService::kClientReportPhishingUrl, | 104 ClientSideDetectionService::GetClientReportPhishingUrl(), |
| 105 response_data, success); | 105 response_data, success); |
| 106 } | 106 } |
| 107 | 107 |
| 108 int GetNumReports() { | 108 int GetNumReports() { |
| 109 return csd_service_->GetNumReports(); | 109 return csd_service_->GetNumReports(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 std::queue<base::Time>& GetPhishingReportTimes() { | 112 std::queue<base::Time>& GetPhishingReportTimes() { |
| 113 return csd_service_->phishing_report_times_; | 113 return csd_service_->phishing_report_times_; |
| 114 } | 114 } |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 EXPECT_CALL(*service, ScheduleFetchModel(_)) | 656 EXPECT_CALL(*service, ScheduleFetchModel(_)) |
| 657 .WillOnce(Invoke(service, &MockClientSideDetectionService::Schedule)); | 657 .WillOnce(Invoke(service, &MockClientSideDetectionService::Schedule)); |
| 658 EXPECT_CALL(*service, EndFetchModel( | 658 EXPECT_CALL(*service, EndFetchModel( |
| 659 ClientSideDetectionService::MODEL_NOT_CHANGED)) | 659 ClientSideDetectionService::MODEL_NOT_CHANGED)) |
| 660 .WillOnce(Invoke(service, &MockClientSideDetectionService::Disable)); | 660 .WillOnce(Invoke(service, &MockClientSideDetectionService::Disable)); |
| 661 csd_service_->SetEnabledAndRefreshState(true); | 661 csd_service_->SetEnabledAndRefreshState(true); |
| 662 EXPECT_FALSE(SendClientReportPhishingRequest(GURL("http://a.com/"), 0.4f)); | 662 EXPECT_FALSE(SendClientReportPhishingRequest(GURL("http://a.com/"), 0.4f)); |
| 663 Mock::VerifyAndClearExpectations(service); | 663 Mock::VerifyAndClearExpectations(service); |
| 664 } | 664 } |
| 665 } // namespace safe_browsing | 665 } // namespace safe_browsing |
| OLD | NEW |