summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
diff options
context:
space:
mode:
authorbryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-08 04:29:25 +0000
committerbryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-08 04:29:25 +0000
commitf508e4e37229721672f9f567b856986859ff323c (patch)
treec66f307681bd976ff3474a540649cc05476ed06d /chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
parentb1c8b494a5a11f64d452d9ace5c98bd599bb1a38 (diff)
downloadchromium_src-f508e4e37229721672f9f567b856986859ff323c.zip
chromium_src-f508e4e37229721672f9f567b856986859ff323c.tar.gz
chromium_src-f508e4e37229721672f9f567b856986859ff323c.tar.bz2
Remove the check of the whitelist entries in ClientPhishingResponse.
The URL is always included in the pingback now, so this whitelist checking can happen on the server. Also, mark this and the ClientPhishingRequest.hash_prefix field as OBSOLETE in the protocol buffer file. BUG=none TEST=updated ClientSideDetectionServiceTest Review URL: http://codereview.chromium.org/8854004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/client_side_detection_service_unittest.cc')
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_service_unittest.cc45
1 files changed, 2 insertions, 43 deletions
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 2aa7596..56dc133 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc
@@ -354,19 +354,11 @@ TEST_F(ClientSideDetectionServiceTest, SendClientReportPhishingRequest) {
false /* success */);
EXPECT_FALSE(SendClientReportPhishingRequest(second_url, score));
- // This is a false positive.
- response.set_phishy(true);
- response.add_whitelist_expression("c.com/a.html");
- SetClientReportPhishingResponse(response.SerializeAsString(),
- true /* success */);
- GURL third_url("http://c.com/");
- EXPECT_FALSE(SendClientReportPhishingRequest(third_url, score));
-
base::Time after = base::Time::Now();
- // Check that we have recorded all 4 requests within the correct time range.
+ // Check that we have recorded all 3 requests within the correct time range.
std::queue<base::Time>& report_times = GetPhishingReportTimes();
- EXPECT_EQ(4U, report_times.size());
+ EXPECT_EQ(3U, report_times.size());
while (!report_times.empty()) {
base::Time time = report_times.back();
report_times.pop();
@@ -663,37 +655,4 @@ TEST_F(ClientSideDetectionServiceTest, SetEnabledAndRefreshState) {
EXPECT_FALSE(SendClientReportPhishingRequest(GURL("http://a.com/"), 0.4f));
Mock::VerifyAndClearExpectations(service);
}
-
-TEST_F(ClientSideDetectionServiceTest, IsFalsePositiveResponse) {
- GURL url("http://www.google.com/");
- ClientPhishingResponse response;
-
- // If the response is not phishing is should never be a false positive.
- response.set_phishy(false);
- response.add_whitelist_expression("www.google.com/");
- EXPECT_FALSE(ClientSideDetectionService::IsFalsePositiveResponse(
- url, response));
-
- // If there are no entries in the whitelist it should always return false.
- response.clear_whitelist_expression();
- response.set_phishy(true);
- EXPECT_FALSE(ClientSideDetectionService::IsFalsePositiveResponse(
- url, response));
-
- // If the URL doesn't match any whitelist entries it whould return false.
- response.add_whitelist_expression("www.yahoo.com/");
- EXPECT_FALSE(ClientSideDetectionService::IsFalsePositiveResponse(
- url, response));
-
- // If the URL matches the whitelist it should return true.
- response.add_whitelist_expression("google.com/");
- EXPECT_TRUE(ClientSideDetectionService::IsFalsePositiveResponse(
- url, response));
-
- // If an entry in the whitelist matches the URL it should return true.
- response.clear_whitelist_expression();
- response.add_whitelist_expression("www.google.com/a/b.html");
- EXPECT_TRUE(ClientSideDetectionService::IsFalsePositiveResponse(
- url, response));
-}
} // namespace safe_browsing