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

Side by Side Diff: chrome/browser/ui/tab_contents/tab_contents_iterator_unittest.cc

Issue 1931503002: Add BackgroundModeOptimizer that can restart the browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PushKeepAlive
Patch Set: address comments. disable feature by default Created 4 years, 4 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
« no previous file with comments | « chrome/browser/lifetime/keep_alive_registry.cc ('k') | chrome/chrome_browser.gypi » ('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/ui/tab_contents/tab_contents_iterator.h" 5 #include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 message_center::MessageCenter::Initialize(); 189 message_center::MessageCenter::Initialize();
190 TestingBrowserProcess* testing_browser_process = 190 TestingBrowserProcess* testing_browser_process =
191 TestingBrowserProcess::GetGlobal(); 191 TestingBrowserProcess::GetGlobal();
192 testing_browser_process->SetLocalState(&testing_pref_service); 192 testing_browser_process->SetLocalState(&testing_pref_service);
193 ASSERT_TRUE(g_browser_process->local_state()); 193 ASSERT_TRUE(g_browser_process->local_state());
194 ProfileManager* profile_manager = new ProfileManager(base::FilePath()); 194 ProfileManager* profile_manager = new ProfileManager(base::FilePath());
195 testing_browser_process->SetProfileManager(profile_manager); 195 testing_browser_process->SetProfileManager(profile_manager);
196 196
197 chrome::AttemptRestart(); 197 chrome::AttemptRestart();
198 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted));
199
198 // Cancel the effects of us calling chrome::AttemptRestart. Otherwise tests 200 // Cancel the effects of us calling chrome::AttemptRestart. Otherwise tests
199 // ran after this one will fail. 201 // ran after this one will fail.
200 browser_shutdown::SetTryingToQuit(false); 202 browser_shutdown::SetTryingToQuit(false);
201 203
202 EXPECT_TRUE(testing_pref_service.GetBoolean(prefs::kWasRestarted));
203 testing_browser_process->SetLocalState(NULL); 204 testing_browser_process->SetLocalState(NULL);
204 } 205 }
OLDNEW
« no previous file with comments | « chrome/browser/lifetime/keep_alive_registry.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698