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

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

Issue 173133004: Separate pre-classification checks for client-side malware and phishing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Set right enum type for boolean histograms. Created 6 years, 9 months 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 b5f64d5eb348415588d83fa4d98107cf7127c53d..5762847a7e723f4979e429045ce81d91a54b4b84 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -472,25 +472,22 @@ TEST_F(ClientSideDetectionServiceTest, SendClientReportMalwareRequest) {
net::URLRequestStatus::FAILED);
EXPECT_FALSE(SendClientReportMalwareRequest(url));
- // server blacklist decision is false, and response is succesful
+ // Server blacklist decision is false, and response is successful
response.set_blacklist(false);
SetClientReportMalwareResponse(response.SerializeAsString(), net::HTTP_OK,
net::URLRequestStatus::SUCCESS);
EXPECT_FALSE(SendClientReportMalwareRequest(url));
- // Check that we have recorded all 4 requests within the correct time range.
+ // Check that we have recorded all 5 requests within the correct time range.
base::Time after = base::Time::Now();
std::queue<base::Time>& report_times = GetMalwareReportTimes();
- EXPECT_EQ(4U, report_times.size());
+ EXPECT_EQ(5U, report_times.size());
- // Another normal behavior will fail because of the limit is hit
- response.set_blacklist(true);
- SetClientReportMalwareResponse(response.SerializeAsString(), net::HTTP_OK,
- net::URLRequestStatus::SUCCESS);
- EXPECT_FALSE(SendClientReportMalwareRequest(url));
+ // Check that the malware report limit was reached.
+ EXPECT_TRUE(csd_service_->OverMalwareReportLimit());
report_times = GetMalwareReportTimes();
- EXPECT_EQ(4U, report_times.size());
+ EXPECT_EQ(5U, report_times.size());
while (!report_times.empty()) {
base::Time time = report_times.back();
report_times.pop();
« no previous file with comments | « chrome/browser/safe_browsing/client_side_detection_service.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698