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

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

Issue 1073633002: Remove PrerenderLocalPredictor, part 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prerender-local-predictor-1
Patch Set: fix tests Created 5 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
Index: chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
index 4fc2bf1508ccfee4996a5d68494dce4c47fbba13..e1deff07de744b3a48e5ac5e9c4bc8e48457c51b 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -288,8 +288,6 @@ class SafeBrowsingDatabaseTest : public PlatformTest {
new SafeBrowsingStoreFile(task_runner_);
SafeBrowsingStoreFile* extension_blacklist_store =
new SafeBrowsingStoreFile(task_runner_);
- SafeBrowsingStoreFile* side_effect_free_whitelist_store =
- new SafeBrowsingStoreFile(task_runner_);
SafeBrowsingStoreFile* ip_blacklist_store =
new SafeBrowsingStoreFile(task_runner_);
SafeBrowsingStoreFile* unwanted_software_store =
@@ -297,8 +295,8 @@ class SafeBrowsingDatabaseTest : public PlatformTest {
database_.reset(new SafeBrowsingDatabaseNew(
task_runner_, browse_store, download_store, csd_whitelist_store,
download_whitelist_store, inclusion_whitelist_store,
- extension_blacklist_store, side_effect_free_whitelist_store,
- ip_blacklist_store, unwanted_software_store));
+ extension_blacklist_store, ip_blacklist_store,
+ unwanted_software_store));
database_->Init(database_filename_);
}
@@ -447,22 +445,17 @@ TEST_F(SafeBrowsingDatabaseTest, ListNames) {
chunks.get());
chunks.clear();
- chunks.push_back(AddChunkFullHashValue(9, "www.sideeffectfree.com"));
- database_->InsertChunks(safe_browsing_util::kSideEffectFreeWhitelist,
- chunks.get());
-
- chunks.clear();
- chunks.push_back(AddChunkHashedIpValue(10, "::ffff:192.168.1.0", 120));
+ chunks.push_back(AddChunkHashedIpValue(9, "::ffff:192.168.1.0", 120));
Scott Hess - ex-Googler 2015/04/08 22:32:26 I don't think you need to renumber these. Unless
davidben 2015/04/09 21:54:38 Done. (The index into lists has to change, but I k
database_->InsertChunks(safe_browsing_util::kIPBlacklist, chunks.get());
chunks.clear();
- chunks.push_back(AddChunkPrefixValue(11, "www.unwanted.com/software.html"));
+ chunks.push_back(AddChunkPrefixValue(10, "www.unwanted.com/software.html"));
database_->InsertChunks(safe_browsing_util::kUnwantedUrlList, chunks.get());
database_->UpdateFinished(true);
GetListsInfo(&lists);
- ASSERT_EQ(10U, lists.size());
+ ASSERT_EQ(9U, lists.size());
EXPECT_EQ(safe_browsing_util::kMalwareList, lists[0].name);
EXPECT_EQ("1", lists[0].adds);
EXPECT_TRUE(lists[0].subs.empty());
@@ -484,15 +477,12 @@ TEST_F(SafeBrowsingDatabaseTest, ListNames) {
EXPECT_EQ(safe_browsing_util::kExtensionBlacklist, lists[6].name);
EXPECT_EQ("8", lists[6].adds);
EXPECT_TRUE(lists[6].subs.empty());
- EXPECT_EQ(safe_browsing_util::kSideEffectFreeWhitelist, lists[7].name);
+ EXPECT_EQ(safe_browsing_util::kIPBlacklist, lists[7].name);
EXPECT_EQ("9", lists[7].adds);
EXPECT_TRUE(lists[7].subs.empty());
- EXPECT_EQ(safe_browsing_util::kIPBlacklist, lists[8].name);
+ EXPECT_EQ(safe_browsing_util::kUnwantedUrlList, lists[8].name);
EXPECT_EQ("10", lists[8].adds);
EXPECT_TRUE(lists[8].subs.empty());
- EXPECT_EQ(safe_browsing_util::kUnwantedUrlList, lists[9].name);
- EXPECT_EQ("11", lists[9].adds);
- EXPECT_TRUE(lists[9].subs.empty());
database_.reset();
}
@@ -513,7 +503,7 @@ TEST_F(SafeBrowsingDatabaseTest, BrowseAndUnwantedDatabasesAndPrefixSets) {
&SafeBrowsingDatabase::ContainsBrowseUrl },
{ safe_browsing_util::kPhishingList, 1U,
&SafeBrowsingDatabase::ContainsBrowseUrl },
- { safe_browsing_util::kUnwantedUrlList, 9U,
+ { safe_browsing_util::kUnwantedUrlList, 8U,
&SafeBrowsingDatabase::ContainsUnwantedSoftwareUrl },
};
@@ -1127,7 +1117,7 @@ TEST_F(SafeBrowsingDatabaseTest, DISABLED_FileCorruptionHandling) {
base::MessageLoop loop;
SafeBrowsingStoreFile* store = new SafeBrowsingStoreFile(task_runner_);
database_.reset(new SafeBrowsingDatabaseNew(
- task_runner_, store, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL));
+ task_runner_, store, NULL, NULL, NULL, NULL, NULL, NULL, NULL));
database_->Init(database_filename_);
// This will cause an empty database to be created.
@@ -1302,7 +1292,7 @@ TEST_F(SafeBrowsingDatabaseTest, Whitelists) {
// If the whitelist is disabled everything should match the whitelist.
database_.reset(new SafeBrowsingDatabaseNew(
task_runner_, new SafeBrowsingStoreFile(task_runner_), NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL));
+ NULL, NULL, NULL, NULL));
database_->Init(database_filename_);
for (const auto& test_case : kTestCases) {
SCOPED_TRACE(std::string("Tested list at fault => ") +

Powered by Google App Engine
This is Rietveld 408576698