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

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

Issue 324983006: Drop support for reading PrefixSet v1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/prefix_set.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/prefix_set_unittest.cc
diff --git a/chrome/browser/safe_browsing/prefix_set_unittest.cc b/chrome/browser/safe_browsing/prefix_set_unittest.cc
index e537ad918257ecf88826c9d867463db60fc5cfe7..4c407f986f767584b0bd34ebb7a4ee8d0b77b078 100644
--- a/chrome/browser/safe_browsing/prefix_set_unittest.cc
+++ b/chrome/browser/safe_browsing/prefix_set_unittest.cc
@@ -629,8 +629,8 @@ TEST_F(PrefixSetTest, FullHashBuild) {
EXPECT_FALSE(prefix_set->PrefixExists(kHash6.prefix));
}
-// Test that a version 1 file is re-ordered correctly on read.
-TEST_F(PrefixSetTest, ReadWriteSigned) {
+// Test that a version 1 file is discarded on read.
+TEST_F(PrefixSetTest, ReadSigned) {
base::FilePath filename;
ASSERT_TRUE(GetPrefixSetFile(&filename));
@@ -670,25 +670,9 @@ TEST_F(PrefixSetTest, ReadWriteSigned) {
CleanChecksum(file.get());
file.reset(); // Flush updates.
- scoped_ptr<PrefixSet> prefix_set = PrefixSet::LoadFile(filename);
- ASSERT_TRUE(prefix_set.get());
-
- // |PrefixExists()| uses |std::upper_bound()| to find a starting point, which
- // assumes |index_| is sorted. Depending on how |upper_bound()| is
- // implemented, if the actual list is sorted by |int32|, then one of these
- // test pairs should fail.
- EXPECT_TRUE(prefix_set->PrefixExists(1000u));
- EXPECT_TRUE(prefix_set->PrefixExists(1023u));
- EXPECT_TRUE(prefix_set->PrefixExists(static_cast<uint32>(-1000)));
- EXPECT_TRUE(prefix_set->PrefixExists(static_cast<uint32>(-1000 + 23)));
-
- std::vector<SBPrefix> prefixes_copy;
- prefix_set->GetPrefixes(&prefixes_copy);
- EXPECT_EQ(prefixes_copy.size(), 4u);
- EXPECT_EQ(prefixes_copy[0], 1000u);
- EXPECT_EQ(prefixes_copy[1], 1023u);
- EXPECT_EQ(prefixes_copy[2], static_cast<uint32>(-1000));
- EXPECT_EQ(prefixes_copy[3], static_cast<uint32>(-1000 + 23));
+ scoped_ptr<safe_browsing::PrefixSet>
+ prefix_set(safe_browsing::PrefixSet::LoadFile(filename));
+ ASSERT_FALSE(prefix_set.get());
}
// Test that a golden v2 file can be read by the current code. All platforms
« no previous file with comments | « chrome/browser/safe_browsing/prefix_set.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698