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

Side by Side Diff: chrome/browser/ui/browser_list_unittest.cc

Issue 10409022: Move application lifetime functionality off BrowserList. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser_list_stub.cc ('k') | chrome/browser/ui/browser_list_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser_process.h" 5 #include "chrome/browser/browser_process.h"
6 #include "chrome/browser/browser_shutdown.h" 6 #include "chrome/browser/browser_shutdown.h"
7 #include "chrome/browser/lifetime/application_lifetime.h"
7 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
8 #include "chrome/browser/printing/background_printing_manager.h" 9 #include "chrome/browser/printing/background_printing_manager.h"
9 #include "chrome/browser/profiles/profile_manager.h" 10 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/ui/browser_list.h" 11 #include "chrome/browser/ui/browser_list.h"
11 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 12 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
12 #include "chrome/common/pref_names.h" 13 #include "chrome/common/pref_names.h"
13 #include "chrome/common/url_constants.h" 14 #include "chrome/common/url_constants.h"
14 #include "chrome/test/base/browser_with_test_window_test.h" 15 #include "chrome/test/base/browser_with_test_window_test.h"
15 #include "chrome/test/base/testing_browser_process.h" 16 #include "chrome/test/base/testing_browser_process.h"
16 #include "chrome/test/base/testing_pref_service.h" 17 #include "chrome/test/base/testing_pref_service.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 testing_pref_service.RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown, 256 testing_pref_service.RegisterBooleanPref(prefs::kRestartLastSessionOnShutdown,
256 false); 257 false);
257 258
258 TestingBrowserProcess* testing_browser_process = 259 TestingBrowserProcess* testing_browser_process =
259 static_cast<TestingBrowserProcess*>(g_browser_process); 260 static_cast<TestingBrowserProcess*>(g_browser_process);
260 testing_browser_process->SetLocalState(&testing_pref_service); 261 testing_browser_process->SetLocalState(&testing_pref_service);
261 ASSERT_TRUE(g_browser_process->local_state()); 262 ASSERT_TRUE(g_browser_process->local_state());
262 ProfileManager* profile_manager = new ProfileManager(FilePath()); 263 ProfileManager* profile_manager = new ProfileManager(FilePath());
263 testing_browser_process->SetProfileManager(profile_manager); 264 testing_browser_process->SetProfileManager(profile_manager);
264 265
265 BrowserList::AttemptRestart(); 266 browser::AttemptRestart();
266 // Cancel the effects of us calling BrowserList::AttemptRestart. Otherwise 267 // Cancel the effects of us calling browser::AttemptRestart. Otherwise tests
267 // tests ran after this one will fail. 268 // ran after this one will fail.
268 browser_shutdown::SetTryingToQuit(false); 269 browser_shutdown::SetTryingToQuit(false);
269 270
270 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted)); 271 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted));
271 testing_browser_process->SetLocalState(NULL); 272 testing_browser_process->SetLocalState(NULL);
272 } 273 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_list_stub.cc ('k') | chrome/browser/ui/browser_list_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698