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

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_database_unittest.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Unit tests for the SafeBrowsing storage system. 5 // Unit tests for the SafeBrowsing storage system.
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_path.h" 8 #include "base/file_path.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 902
903 // Prefix miss cache should be cleared. 903 // Prefix miss cache should be cleared.
904 EXPECT_EQ(database->prefix_miss_cache()->size(), 0U); 904 EXPECT_EQ(database->prefix_miss_cache()->size(), 0U);
905 905
906 lists.clear(); 906 lists.clear();
907 prefixes.clear(); 907 prefixes.clear();
908 full_hashes.clear(); 908 full_hashes.clear();
909 909
910 // Test receiving a full add chunk. The old implementation doesn't support 910 // Test receiving a full add chunk. The old implementation doesn't support
911 // this test, so we bail here. 911 // this test, so we bail here.
912 if (CommandLine().HasSwitch(switches::kUseOldSafeBrowsing)) { 912 if (CommandLine::ForCurrentProcess()->HasSwitch(
913 switches::kUseOldSafeBrowsing)) {
913 TearDownTestDatabase(database); 914 TearDownTestDatabase(database);
914 return; 915 return;
915 } 916 }
916 917
917 host.host = Sha256Prefix("www.fullevil.com/"); 918 host.host = Sha256Prefix("www.fullevil.com/");
918 host.entry = SBEntry::Create(SBEntry::ADD_FULL_HASH, 2); 919 host.entry = SBEntry::Create(SBEntry::ADD_FULL_HASH, 2);
919 host.entry->set_chunk_id(20); 920 host.entry->set_chunk_id(20);
920 SBFullHash full_add1; 921 SBFullHash full_add1;
921 base::SHA256HashString("www.fullevil.com/bad1.html", 922 base::SHA256HashString("www.fullevil.com/bad1.html",
922 &full_add1.full_hash, sizeof(SBFullHash)); 923 &full_add1.full_hash, sizeof(SBFullHash));
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 TEST(SafeBrowsingDatabase, DISABLED_DatabaseOldLotsofDeletesIO) { 1239 TEST(SafeBrowsingDatabase, DISABLED_DatabaseOldLotsofDeletesIO) {
1239 std::vector<ChunksInfo> chunks; 1240 std::vector<ChunksInfo> chunks;
1240 std::vector<SBChunkDelete>* deletes = new std::vector<SBChunkDelete>; 1241 std::vector<SBChunkDelete>* deletes = new std::vector<SBChunkDelete>;
1241 SBChunkDelete del; 1242 SBChunkDelete del;
1242 del.is_sub_del = false; 1243 del.is_sub_del = false;
1243 del.list_name = safe_browsing_util::kMalwareList; 1244 del.list_name = safe_browsing_util::kMalwareList;
1244 del.chunk_del.push_back(ChunkRange(3539, 3579)); 1245 del.chunk_del.push_back(ChunkRange(3539, 3579));
1245 deletes->push_back(del); 1246 deletes->push_back(del);
1246 PeformUpdate(GetOldSafeBrowsingPath(), chunks, deletes); 1247 PeformUpdate(GetOldSafeBrowsingPath(), chunks, deletes);
1247 } 1248 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database.cc ('k') | chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698