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

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

Issue 7793012: Change the client-side phishing detection hashing function to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Brian's comments Created 9 years, 4 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/browser_feature_extractor_unittest.cc
diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
index 3156f2823130330c1e587400b1ade9bf370ae5cd..71b7b4676093edee9c41c21af56f486b0f148c2c 100644
--- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
+++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc
@@ -488,8 +488,8 @@ TEST_F(BrowserFeatureExtractorTest, URLHashes) {
EXPECT_TRUE(ExtractFeatures(&request));
EXPECT_EQ(crypto::SHA256HashString("host.com/").substr(
- 0, BrowserFeatureExtractor::kSuffixPrefixHashLength),
- request.suffix_prefix_hash());
+ 0, BrowserFeatureExtractor::kHashPrefixLength),
+ request.hash_prefix());
request.set_url("http://www.host.com/path/");
history_service()->AddPage(GURL("http://www.host.com/path/"),
@@ -497,9 +497,9 @@ TEST_F(BrowserFeatureExtractorTest, URLHashes) {
contents()->NavigateAndCommit(GURL("http://www.host.com/path/"));
EXPECT_TRUE(ExtractFeatures(&request));
- EXPECT_EQ(crypto::SHA256HashString("www.host.com/path/").substr(
- 0, BrowserFeatureExtractor::kSuffixPrefixHashLength),
- request.suffix_prefix_hash());
+ EXPECT_EQ(crypto::SHA256HashString("host.com/path/").substr(
+ 0, BrowserFeatureExtractor::kHashPrefixLength),
+ request.hash_prefix());
request.set_url("http://user@www.host.com:1111/path/123?args");
history_service()->AddPage(
@@ -509,9 +509,9 @@ TEST_F(BrowserFeatureExtractorTest, URLHashes) {
GURL("http://user@www.host.com:1111/path/123?args"));
EXPECT_TRUE(ExtractFeatures(&request));
- EXPECT_EQ(crypto::SHA256HashString("www.host.com/path/123").substr(
- 0, BrowserFeatureExtractor::kSuffixPrefixHashLength),
- request.suffix_prefix_hash());
+ EXPECT_EQ(crypto::SHA256HashString("host.com/path/").substr(
+ 0, BrowserFeatureExtractor::kHashPrefixLength),
+ request.hash_prefix());
// Check that escaping matches the SafeBrowsing specification.
request.set_url("http://www.host.com/A%21//B");
@@ -520,8 +520,8 @@ TEST_F(BrowserFeatureExtractorTest, URLHashes) {
contents()->NavigateAndCommit(GURL("http://www.host.com/A%21//B"));
EXPECT_TRUE(ExtractFeatures(&request));
- EXPECT_EQ(crypto::SHA256HashString("www.host.com/A!/B").substr(
- 0, BrowserFeatureExtractor::kSuffixPrefixHashLength),
- request.suffix_prefix_hash());
+ EXPECT_EQ(crypto::SHA256HashString("host.com/a!/").substr(
+ 0, BrowserFeatureExtractor::kHashPrefixLength),
+ request.hash_prefix());
}
} // namespace safe_browsing

Powered by Google App Engine
This is Rietveld 408576698