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

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

Issue 67243: Reduce the false positive rate for SafeBrowsing gethash requests (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database_bloom.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_database_unittest.cc (revision 13914)
+++ chrome/browser/safe_browsing/safe_browsing_database_unittest.cc (working copy)
@@ -905,6 +905,19 @@
// Prefix miss cache should be cleared.
EXPECT_EQ(database->prefix_miss_cache()->size(), 0U);
+ // Cache a GetHash miss for a particular prefix, and even though the prefix is
+ // in the database, it is flagged as a miss so looking up the associated URL
+ // will not succeed.
+ prefixes.clear();
+ full_hashes.clear();
+ prefix_misses.clear();
+ empty_full_hash.clear();
+ prefix_misses.push_back(Sha256Prefix("www.evil.com/phishing.html"));
+ database->CacheHashResults(prefix_misses, empty_full_hash);
+ EXPECT_FALSE(database->ContainsUrl(GURL("http://www.evil.com/phishing.html"),
+ &listname, &prefixes,
+ &full_hashes, Time::Now()));
+
lists.clear();
prefixes.clear();
full_hashes.clear();
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database_bloom.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698