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

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

Issue 744183002: More explicit thread checking in SafeBrowsingDatabase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@a3_deadcode
Patch Set: crbug.com/338486 forces thread-checks to be disabled in ~SafeBrowsingStoreFile() Created 6 years 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 db83263ea44e937dd4994cf7189220a6028962f7..56df6cb1dbeb3552b7113c2430a4f73ff0120c74 100644
--- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc
@@ -331,6 +331,11 @@ class SafeBrowsingDatabaseTest : public PlatformTest {
scoped_ptr<SafeBrowsingDatabaseNew> database_;
base::FilePath database_filename_;
base::ScopedTempDir temp_dir_;
+
+ // We expect most checks made on |database_| to be made from the IO thread.
+ // Use this ThreadBundle to fake the IO thread in the main message loop in
+ // these tests.
+ content::TestBrowserThreadBundle thread_bundle_;
};
// Tests retrieving list name information.
@@ -1239,12 +1244,6 @@ TEST_F(SafeBrowsingDatabaseTest, ContainsDownloadUrl) {
// Checks that the whitelists are handled properly.
TEST_F(SafeBrowsingDatabaseTest, Whitelists) {
- database_.reset();
-
- // We expect all calls to ContainsCsdWhitelistedUrl in particular to be made
- // from the IO thread. In general the whitelist lookups are thread-safe.
- content::TestBrowserThreadBundle thread_bundle_;
-
// If the whitelist is disabled everything should match the whitelist.
database_.reset(new SafeBrowsingDatabaseNew(new SafeBrowsingStoreFile(),
NULL, NULL, NULL, NULL, NULL,

Powered by Google App Engine
This is Rietveld 408576698