diff options
Diffstat (limited to 'chrome/browser/importer/importer_unittest.cc')
-rw-r--r-- | chrome/browser/importer/importer_unittest.cc | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc index 2bad8ee..214f056 100644 --- a/chrome/browser/importer/importer_unittest.cc +++ b/chrome/browser/importer/importer_unittest.cc @@ -115,14 +115,14 @@ class ImporterTest : public testing::Test { profile_info.browser_type = FIREFOX3; profile_info.app_path = app_path_; profile_info.source_path = profile_path_; - scoped_refptr<ImporterHost> host = new ImporterHost(); + scoped_refptr<ImporterHost> host(new ImporterHost()); host->SetObserver(observer); int items = HISTORY | PASSWORDS | FAVORITES; if (import_search_plugins) items = items | SEARCH_ENGINES; loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(), &ImporterHost::StartImportSettings, profile_info, - static_cast<Profile*>(NULL), items, writer, true)); + static_cast<Profile*>(NULL), items, make_scoped_refptr(writer), true)); loop->Run(); } @@ -697,7 +697,7 @@ TEST_F(ImporterTest, MAYBE(Firefox2Importer)) { ASSERT_TRUE(file_util::CopyDirectory(data_path, search_engine_path, false)); MessageLoop* loop = MessageLoop::current(); - scoped_refptr<ImporterHost> host = new ImporterHost(); + scoped_refptr<ImporterHost> host(new ImporterHost()); FirefoxObserver* observer = new FirefoxObserver(); host->SetObserver(observer); ProfileInfo profile_info; @@ -705,10 +705,14 @@ TEST_F(ImporterTest, MAYBE(Firefox2Importer)) { profile_info.app_path = app_path_; profile_info.source_path = profile_path_; - loop->PostTask(FROM_HERE, NewRunnableMethod(host.get(), - &ImporterHost::StartImportSettings, profile_info, + loop->PostTask(FROM_HERE, NewRunnableMethod( + host.get(), + &ImporterHost::StartImportSettings, + profile_info, static_cast<Profile*>(NULL), - HISTORY | PASSWORDS | FAVORITES | SEARCH_ENGINES, observer, true)); + HISTORY | PASSWORDS | FAVORITES | SEARCH_ENGINES, + make_scoped_refptr(observer), + true)); loop->Run(); } @@ -880,15 +884,15 @@ class Firefox3Observer : public ProfileWriter, }; TEST_F(ImporterTest, MAYBE(Firefox30Importer)) { - scoped_refptr<Firefox3Observer> observer = new Firefox3Observer(); + scoped_refptr<Firefox3Observer> observer(new Firefox3Observer()); Firefox3xImporterTest("firefox3_profile", observer.get(), observer.get(), true); } TEST_F(ImporterTest, MAYBE(Firefox35Importer)) { bool import_search_engines = false; - scoped_refptr<Firefox3Observer> observer = - new Firefox3Observer(import_search_engines); + scoped_refptr<Firefox3Observer> observer( + new Firefox3Observer(import_search_engines)); Firefox3xImporterTest("firefox35_profile", observer.get(), observer.get(), import_search_engines); } |