Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7723)

Unified Diff: chrome/browser/safe_browsing/client_side_detection_service_unittest.cc

Issue 48713008: [sync] Allow FakeURLFetcher to return arbitrary HTTP response codes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
index e32dcc45e45b2ca4e9187cf627ec01f469711c0b..b41d44a61c6ad9a48a8ab638d56a93d05963925d 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -17,6 +17,7 @@
#include "chrome/common/safe_browsing/csd.pb.h"
#include "content/public/test/test_browser_thread.h"
#include "crypto/sha2.h"
+#include "net/http/http_status_code.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_status.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -107,7 +108,9 @@ class ClientSideDetectionServiceTest : public testing::Test {
void SetModelFetchResponse(std::string response_data, bool success) {
factory_->SetFakeResponse(GURL(ClientSideDetectionService::kClientModelUrl),
- response_data, success);
+ response_data,
+ success ? net::HTTP_OK :
+ net::HTTP_INTERNAL_SERVER_ERROR);
}
void SetClientReportPhishingResponse(std::string response_data,
@@ -115,7 +118,9 @@ class ClientSideDetectionServiceTest : public testing::Test {
factory_->SetFakeResponse(
ClientSideDetectionService::GetClientReportUrl(
ClientSideDetectionService::kClientReportPhishingUrl),
- response_data, success);
+ response_data,
+ success ? net::HTTP_OK :
+ net::HTTP_INTERNAL_SERVER_ERROR);
}
void SetClientReportMalwareResponse(std::string response_data,
@@ -123,7 +128,9 @@ class ClientSideDetectionServiceTest : public testing::Test {
factory_->SetFakeResponse(
ClientSideDetectionService::GetClientReportUrl(
ClientSideDetectionService::kClientReportMalwareUrl),
- response_data, success);
+ response_data,
+ success ? net::HTTP_OK :
+ net::HTTP_INTERNAL_SERVER_ERROR);
}
int GetNumReports(std::queue<base::Time>* report_times) {

Powered by Google App Engine
This is Rietveld 408576698