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

Side by Side Diff: content/public/test/browser_test_base.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/public/test/browser_test_base.h" 5 #include "content/public/test/browser_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
11 #include "content/browser/renderer_host/render_process_host_impl.h" 11 #include "content/browser/renderer_host/render_process_host_impl.h"
12 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
13 #include "content/public/common/content_switches.h" 13 #include "content/public/common/content_switches.h"
14 #include "content/public/common/main_function_params.h" 14 #include "content/public/common/main_function_params.h"
15 #include "content/public/test/test_utils.h" 15 #include "content/public/test/test_utils.h"
16 #include "net/test/embedded_test_server/embedded_test_server.h" 16 #include "net/test/embedded_test_server/embedded_test_server.h"
17 17
18 #if defined(OS_MACOSX) 18 #if defined(OS_MACOSX)
19 #include "base/mac/mac_util.h" 19 #include "base/mac/mac_util.h"
20 #include "base/power_monitor/power_monitor.h" 20 #include "base/power_monitor/power_monitor_device_source.h"
21 #endif 21 #endif
22 22
23 #if defined(OS_ANDROID) 23 #if defined(OS_ANDROID)
24 #include "base/threading/thread_restrictions.h" 24 #include "base/threading/thread_restrictions.h"
25 #include "content/public/browser/browser_main_runner.h" 25 #include "content/public/browser/browser_main_runner.h"
26 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #endif 27 #endif
28 28
29 namespace content { 29 namespace content {
30 namespace { 30 namespace {
(...skipping 26 matching lines...) Expand all
57 } // namespace 57 } // namespace
58 58
59 extern int BrowserMain(const MainFunctionParams&); 59 extern int BrowserMain(const MainFunctionParams&);
60 60
61 BrowserTestBase::BrowserTestBase() 61 BrowserTestBase::BrowserTestBase()
62 : embedded_test_server_( 62 : embedded_test_server_(
63 new net::test_server::EmbeddedTestServer( 63 new net::test_server::EmbeddedTestServer(
64 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))) { 64 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))) {
65 #if defined(OS_MACOSX) 65 #if defined(OS_MACOSX)
66 base::mac::SetOverrideAmIBundled(true); 66 base::mac::SetOverrideAmIBundled(true);
67 base::PowerMonitor::AllocateSystemIOPorts(); 67 base::PowerMonitorDeviceSource::AllocateSystemIOPorts();
68 #endif 68 #endif
69 69
70 #if defined(OS_POSIX) 70 #if defined(OS_POSIX)
71 handle_sigterm_ = true; 71 handle_sigterm_ = true;
72 #endif 72 #endif
73 } 73 }
74 74
75 BrowserTestBase::~BrowserTestBase() { 75 BrowserTestBase::~BrowserTestBase() {
76 #if defined(OS_ANDROID) 76 #if defined(OS_ANDROID)
77 // RemoteTestServer can cause wait on the UI thread. 77 // RemoteTestServer can cause wait on the UI thread.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); 143 RenderProcessHostImpl::GetInProcessRendererThreadForTesting();
144 CHECK(renderer_loop); 144 CHECK(renderer_loop);
145 145
146 renderer_loop->PostTask( 146 renderer_loop->PostTask(
147 FROM_HERE, 147 FROM_HERE,
148 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); 148 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure()));
149 runner->Run(); 149 runner->Run();
150 } 150 }
151 151
152 } // namespace content 152 } // namespace content
OLDNEW
« content/gpu/gpu_main.cc ('K') | « content/gpu/gpu_main.cc ('k') | ipc/ipc_message_start.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698