Index: chrome/browser/sync/profile_sync_service_session_unittest.cc |
diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc |
index c42edc27931622288c0c8e3c8e2d8dd2b72456b6..ef15c6601a08117236a139f0447cd9fda5571586 100644 |
--- a/chrome/browser/sync/profile_sync_service_session_unittest.cc |
+++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc |
@@ -12,7 +12,7 @@ |
#include "base/files/scoped_temp_dir.h" |
#include "base/location.h" |
#include "base/memory/scoped_ptr.h" |
-#include "base/message_loop.h" |
+#include "base/run_loop.h" |
#include "base/stl_util.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/time/time.h" |
@@ -42,6 +42,7 @@ |
#include "content/public/browser/notification_service.h" |
#include "content/public/test/test_browser_thread.h" |
#include "google_apis/gaia/gaia_constants.h" |
+#include "net/url_request/test_url_fetcher_factory.h" |
#include "sync/internal_api/public/base/model_type.h" |
#include "sync/internal_api/public/change_record.h" |
#include "sync/internal_api/public/read_node.h" |
@@ -194,8 +195,7 @@ class ProfileSyncServiceSessionTest |
public content::NotificationObserver { |
public: |
ProfileSyncServiceSessionTest() |
- : io_thread_(BrowserThread::IO), |
- window_bounds_(0, 1, 2, 3), |
+ : window_bounds_(0, 1, 2, 3), |
notified_of_update_(false), |
notified_of_refresh_(false) {} |
ProfileSyncService* sync_service() { return sync_service_.get(); } |
@@ -214,8 +214,6 @@ class ProfileSyncServiceSessionTest |
virtual void SetUp() { |
// BrowserWithTestWindowTest implementation. |
BrowserWithTestWindowTest::SetUp(); |
- io_thread_.StartIOThread(); |
- profile()->CreateRequestContext(); |
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
registrar_.Add(this, chrome::NOTIFICATION_FOREIGN_SESSION_UPDATED, |
content::NotificationService::AllSources()); |
@@ -242,7 +240,6 @@ class ProfileSyncServiceSessionTest |
virtual void TearDown() { |
sync_service_->Shutdown(); |
sync_service_.reset(); |
- profile()->ResetRequestContext(); |
// We need to destroy the profile before shutting down the threads, because |
// some of the ref counted objects in the profile depend on their |
@@ -252,9 +249,7 @@ class ProfileSyncServiceSessionTest |
// Pump messages posted by the sync core thread (which may end up |
// posting on the IO thread). |
- base::MessageLoop::current()->RunUntilIdle(); |
- io_thread_.Stop(); |
- base::MessageLoop::current()->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
BrowserWithTestWindowTest::TearDown(); |
} |
@@ -304,7 +299,6 @@ class ProfileSyncServiceSessionTest |
return true; |
} |
- content::TestBrowserThread io_thread_; |
// Path used in testing. |
base::ScopedTempDir temp_dir_; |
SessionModelAssociator* model_associator_; |
@@ -315,6 +309,7 @@ class ProfileSyncServiceSessionTest |
bool notified_of_update_; |
bool notified_of_refresh_; |
content::NotificationRegistrar registrar_; |
+ net::TestURLFetcherFactory fetcher_factory_; |
}; |
class CreateRootHelper { |
@@ -1207,7 +1202,7 @@ TEST_F(ProfileSyncServiceSessionTest, Favicons) { |
// Update associator. |
model_associator_->AssociateForeignSpecifics(meta, base::Time()); |
model_associator_->AssociateForeignSpecifics(tab, base::Time()); |
- base::MessageLoop::current()->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
ASSERT_FALSE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon)); |
// Now add a favicon. |
@@ -1215,7 +1210,7 @@ TEST_F(ProfileSyncServiceSessionTest, Favicons) { |
tab.mutable_tab()->set_favicon_type(sync_pb::SessionTab::TYPE_WEB_FAVICON); |
tab.mutable_tab()->set_favicon("data"); |
model_associator_->AssociateForeignSpecifics(tab, base::Time()); |
- base::MessageLoop::current()->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
ASSERT_TRUE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon)); |
ASSERT_TRUE(CompareMemoryToString("data", favicon)); |
@@ -1226,7 +1221,7 @@ TEST_F(ProfileSyncServiceSessionTest, Favicons) { |
tab.mutable_tab()->clear_favicon_type(); |
tab.mutable_tab()->clear_favicon(); |
model_associator_->AssociateForeignSpecifics(tab, base::Time()); |
- base::MessageLoop::current()->RunUntilIdle(); |
+ base::RunLoop().RunUntilIdle(); |
ASSERT_TRUE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon)); |
} |