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

Unified Diff: components/safe_browsing_db/v4_local_database_manager_unittest.cc

Issue 2622063002: Add the missing callback to client for CheckResourceUrl. (Closed)
Patch Set: rebase Created 3 years, 11 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: components/safe_browsing_db/v4_local_database_manager_unittest.cc
diff --git a/components/safe_browsing_db/v4_local_database_manager_unittest.cc b/components/safe_browsing_db/v4_local_database_manager_unittest.cc
index 958fb2da0b25528106aa62d16e6f91fa2e4ce97e..2b8793245db679c85090846ba00d21e6f3aae327 100644
--- a/components/safe_browsing_db/v4_local_database_manager_unittest.cc
+++ b/components/safe_browsing_db/v4_local_database_manager_unittest.cc
@@ -367,8 +367,8 @@ TEST_F(V4LocalDatabaseManagerTest,
TEST_F(V4LocalDatabaseManagerTest, TestGetSeverestThreatTypeAndMetadata) {
WaitForTasksOnTaskRunner();
- FullHashInfo fhi_malware(FullHash("Malware"), GetUrlMalwareId(),
- base::Time::Now());
+ FullHash full_hash("Malware");
+ FullHashInfo fhi_malware(full_hash, GetUrlMalwareId(), base::Time::Now());
fhi_malware.metadata.population_id = "malware_popid";
FullHashInfo fhi_api(FullHash("api"), GetChromeUrlApiId(), base::Time::Now());
@@ -378,18 +378,21 @@ TEST_F(V4LocalDatabaseManagerTest, TestGetSeverestThreatTypeAndMetadata) {
SBThreatType result_threat_type;
ThreatMetadata metadata;
+ FullHash matching_full_hash;
v4_local_database_manager_->GetSeverestThreatTypeAndMetadata(
- &result_threat_type, &metadata, fhis);
+ &result_threat_type, &metadata, &matching_full_hash, fhis);
EXPECT_EQ(SB_THREAT_TYPE_URL_MALWARE, result_threat_type);
EXPECT_EQ("malware_popid", metadata.population_id);
+ EXPECT_EQ(full_hash, matching_full_hash);
// Reversing the list has no effect.
std::reverse(std::begin(fhis), std::end(fhis));
v4_local_database_manager_->GetSeverestThreatTypeAndMetadata(
- &result_threat_type, &metadata, fhis);
+ &result_threat_type, &metadata, &matching_full_hash, fhis);
EXPECT_EQ(SB_THREAT_TYPE_URL_MALWARE, result_threat_type);
EXPECT_EQ("malware_popid", metadata.population_id);
+ EXPECT_EQ(full_hash, matching_full_hash);
}
TEST_F(V4LocalDatabaseManagerTest, TestChecksAreQueued) {

Powered by Google App Engine
This is Rietveld 408576698