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

Unified Diff: chrome/browser/profiles/profile_manager_unittest.cc

Issue 11759019: Update other unittests to use newly added TestingBrowserProcess::GetGlobal(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: simpler codez Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_manager_unittest.cc
diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc
index 60c605ea10566e1f7bf8045bb962d5bf6839674d..a1463c5be912bd75031e3322e7e2168217cbd139 100644
--- a/chrome/browser/profiles/profile_manager_unittest.cc
+++ b/chrome/browser/profiles/profile_manager_unittest.cc
@@ -90,7 +90,7 @@ class ProfileManagerTest : public testing::Test {
};
ProfileManagerTest()
- : local_state_(static_cast<TestingBrowserProcess*>(g_browser_process)),
+ : local_state_(TestingBrowserProcess::GetGlobal()),
extension_event_router_forwarder_(new extensions::EventRouterForwarder),
ui_thread_(BrowserThread::UI, &message_loop_),
db_thread_(BrowserThread::DB, &message_loop_),
@@ -101,14 +101,13 @@ class ProfileManagerTest : public testing::Test {
base::SystemMonitor::AllocateSystemIOPorts();
#endif
system_monitor_dummy_.reset(new base::SystemMonitor);
- static_cast<TestingBrowserProcess*>(g_browser_process)->SetIOThread(
- &io_thread_);
+ TestingBrowserProcess::GetGlobal()->SetIOThread(&io_thread_);
}
virtual void SetUp() {
// Create a new temporary directory, and store the path
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
- static_cast<TestingBrowserProcess*>(g_browser_process)->SetProfileManager(
+ TestingBrowserProcess::GetGlobal()->SetProfileManager(
new testing::ProfileManager(temp_dir_.path()));
#if defined(OS_CHROMEOS)
@@ -118,8 +117,7 @@ class ProfileManagerTest : public testing::Test {
}
virtual void TearDown() {
- static_cast<TestingBrowserProcess*>(g_browser_process)->SetProfileManager(
- NULL);
+ TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL);
message_loop_.RunUntilIdle();
}
@@ -227,8 +225,7 @@ TEST_F(ProfileManagerTest, CreateAndUseTwoProfiles) {
// Make sure any pending tasks run before we destroy the profiles.
message_loop_.RunUntilIdle();
- static_cast<TestingBrowserProcess*>(g_browser_process)->SetProfileManager(
- NULL);
+ TestingBrowserProcess::GetGlobal()->SetProfileManager(NULL);
// Make sure history cleans up correctly.
message_loop_.RunUntilIdle();

Powered by Google App Engine
This is Rietveld 408576698