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

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

Issue 16950028: Move file_util::Delete to the base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 1640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1651 database_.reset(new SafeBrowsingDatabaseNew); 1651 database_.reset(new SafeBrowsingDatabaseNew);
1652 database_->Init(database_filename_); 1652 database_->Init(database_filename_);
1653 EXPECT_TRUE(database_->ContainsBrowseUrl( 1653 EXPECT_TRUE(database_->ContainsBrowseUrl(
1654 GURL("http://www.evil.com/malware.html"), 1654 GURL("http://www.evil.com/malware.html"),
1655 &matching_list, &prefix_hits, &full_hashes, now)); 1655 &matching_list, &prefix_hits, &full_hashes, now));
1656 EXPECT_FALSE(database_->ContainsBrowseUrl( 1656 EXPECT_FALSE(database_->ContainsBrowseUrl(
1657 GURL("http://www.good.com/goodware.html"), 1657 GURL("http://www.good.com/goodware.html"),
1658 &matching_list, &prefix_hits, &full_hashes, now)); 1658 &matching_list, &prefix_hits, &full_hashes, now));
1659 1659
1660 // If there is no filter file, the database cannot find malware urls. 1660 // If there is no filter file, the database cannot find malware urls.
1661 file_util::Delete(filter_file, false); 1661 base::Delete(filter_file, false);
1662 ASSERT_FALSE(file_util::PathExists(filter_file)); 1662 ASSERT_FALSE(file_util::PathExists(filter_file));
1663 database_.reset(new SafeBrowsingDatabaseNew); 1663 database_.reset(new SafeBrowsingDatabaseNew);
1664 database_->Init(database_filename_); 1664 database_->Init(database_filename_);
1665 EXPECT_FALSE(database_->ContainsBrowseUrl( 1665 EXPECT_FALSE(database_->ContainsBrowseUrl(
1666 GURL("http://www.evil.com/malware.html"), 1666 GURL("http://www.evil.com/malware.html"),
1667 &matching_list, &prefix_hits, &full_hashes, now)); 1667 &matching_list, &prefix_hits, &full_hashes, now));
1668 EXPECT_FALSE(database_->ContainsBrowseUrl( 1668 EXPECT_FALSE(database_->ContainsBrowseUrl(
1669 GURL("http://www.good.com/goodware.html"), 1669 GURL("http://www.good.com/goodware.html"),
1670 &matching_list, &prefix_hits, &full_hashes, now)); 1670 &matching_list, &prefix_hits, &full_hashes, now));
1671 } 1671 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database.cc ('k') | chrome/browser/safe_browsing/safe_browsing_store_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698