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

Unified Diff: chrome/browser/privacy_blacklist/blacklist_manager_unittest.cc

Issue 399016: Fix race conditions where an object's constructor uses PostTask on itself. T... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/privacy_blacklist/blacklist_manager_unittest.cc
===================================================================
--- chrome/browser/privacy_blacklist/blacklist_manager_unittest.cc (revision 32148)
+++ chrome/browser/privacy_blacklist/blacklist_manager_unittest.cc (working copy)
@@ -149,8 +149,8 @@
}
TEST_F(BlacklistManagerTest, Basic) {
- scoped_refptr<BlacklistManager> manager(
- new BlacklistManager(&profile_, &path_provider_));
+ scoped_refptr<BlacklistManager> manager(new BlacklistManager());
+ manager->Initialize(&profile_, &path_provider_);
WaitForBlacklistUpdate();
const Blacklist* blacklist = manager->GetCompiledBlacklist();
@@ -161,8 +161,8 @@
}
TEST_F(BlacklistManagerTest, BlacklistPathProvider) {
- scoped_refptr<BlacklistManager> manager(
- new BlacklistManager(&profile_, &path_provider_));
+ scoped_refptr<BlacklistManager> manager(new BlacklistManager());
+ manager->Initialize(&profile_, &path_provider_);
WaitForBlacklistUpdate();
const Blacklist* blacklist1 = manager->GetCompiledBlacklist();
@@ -196,7 +196,8 @@
path_provider_.clear();
path_provider_.AddPersistentPath(
test_data_dir_.AppendASCII("annoying_ads.pbl"));
- manager = new BlacklistManager(&profile_, &path_provider_);
+ manager = new BlacklistManager();
+ manager->Initialize(&profile_, &path_provider_);
WaitForBlacklistUpdate();
const Blacklist* blacklist4 = manager->GetCompiledBlacklist();
@@ -206,8 +207,8 @@
}
TEST_F(BlacklistManagerTest, BlacklistPathReadError) {
- scoped_refptr<BlacklistManager> manager(
- new BlacklistManager(&profile_, &path_provider_));
+ scoped_refptr<BlacklistManager> manager(new BlacklistManager());
+ manager->Initialize(&profile_, &path_provider_);
WaitForBlacklistUpdate();
FilePath bogus_path(test_data_dir_.AppendASCII("does_not_exist_randomness"));
@@ -223,8 +224,8 @@
FilePath compiled_blacklist_path;
{
- scoped_refptr<BlacklistManager> manager(
- new BlacklistManager(&profile_, &path_provider_));
+ scoped_refptr<BlacklistManager> manager(new BlacklistManager());
+ manager->Initialize(&profile_, &path_provider_);
WaitForBlacklistUpdate();
path_provider_.AddPersistentPath(
@@ -241,8 +242,8 @@
ASSERT_TRUE(file_util::Delete(compiled_blacklist_path, false));
{
- scoped_refptr<BlacklistManager> manager(
- new BlacklistManager(&profile_, &path_provider_));
+ scoped_refptr<BlacklistManager> manager(new BlacklistManager());
+ manager->Initialize(&profile_, &path_provider_);
WaitForBlacklistUpdate();
// The manager should recompile the blacklist.
Property changes on: chrome\browser\privacy_blacklist\blacklist_manager_unittest.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698