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

Side by Side Diff: chrome/browser/browser_main.cc

Issue 113824: Do not monitor system power state during unit tests. (Closed)
Patch Set: Created 11 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
« base/test_suite.h ('K') | « base/time_win.cc ('k') | no next file » | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <commctrl.h> 9 #include <commctrl.h>
10 #endif 10 #endif
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 258
259 // Do platform-specific things (such as finishing initializing Cocoa) 259 // Do platform-specific things (such as finishing initializing Cocoa)
260 // prior to instantiating the message loop. This could be turned into a 260 // prior to instantiating the message loop. This could be turned into a
261 // broadcast notification. 261 // broadcast notification.
262 Platform::WillInitializeMainMessageLoop(parsed_command_line); 262 Platform::WillInitializeMainMessageLoop(parsed_command_line);
263 263
264 MessageLoop main_message_loop(MessageLoop::TYPE_UI); 264 MessageLoop main_message_loop(MessageLoop::TYPE_UI);
265 265
266 // Initialize the SystemMonitor 266 // Initialize the SystemMonitor
267 base::SystemMonitor::Start(); 267 base::SystemMonitor::Start();
268 #if defined(OS_WIN)
269 // We want to monitor system power state to adjust our high resolution
270 // timer settings. But it's necessary only on Windows.
271 base::Time::StartSystemMonitorObserver();
272 #endif // defined(OS_WIN)
268 273
269 // Initialize statistical testing infrastructure. 274 // Initialize statistical testing infrastructure.
270 FieldTrialList field_trial; 275 FieldTrialList field_trial;
271 276
272 std::wstring app_name = chrome::kBrowserAppName; 277 std::wstring app_name = chrome::kBrowserAppName;
273 std::string thread_name_string = WideToASCII(app_name + L"_BrowserMain"); 278 std::string thread_name_string = WideToASCII(app_name + L"_BrowserMain");
274 279
275 const char* thread_name = thread_name_string.c_str(); 280 const char* thread_name = thread_name_string.c_str();
276 PlatformThread::SetName(thread_name); 281 PlatformThread::SetName(thread_name);
277 main_message_loop.set_thread_name(thread_name); 282 main_message_loop.set_thread_name(thread_name);
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 if (metrics) 736 if (metrics)
732 metrics->Stop(); 737 metrics->Stop();
733 738
734 // browser_shutdown takes care of deleting browser_process, so we need to 739 // browser_shutdown takes care of deleting browser_process, so we need to
735 // release it. 740 // release it.
736 browser_process.release(); 741 browser_process.release();
737 browser_shutdown::Shutdown(); 742 browser_shutdown::Shutdown();
738 743
739 return result_code; 744 return result_code;
740 } 745 }
OLDNEW
« base/test_suite.h ('K') | « base/time_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698