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

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: Fixing windows unit test errors Created 7 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 | Annotate | Revision Log
« no previous file with comments | « content/plugin/plugin_main.cc ('k') | content/renderer/renderer_main.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) 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 "content/browser/renderer_host/render_process_host_impl.h" 10 #include "content/browser/renderer_host/render_process_host_impl.h"
11 #include "content/public/browser/browser_thread.h" 11 #include "content/public/browser/browser_thread.h"
12 #include "content/public/common/content_switches.h" 12 #include "content/public/common/content_switches.h"
13 #include "content/public/common/main_function_params.h" 13 #include "content/public/common/main_function_params.h"
14 #include "content/public/test/test_utils.h" 14 #include "content/public/test/test_utils.h"
15 #include "net/test/embedded_test_server/embedded_test_server.h" 15 #include "net/test/embedded_test_server/embedded_test_server.h"
16 16
17 #if defined(OS_POSIX) 17 #if defined(OS_POSIX)
18 #include "base/process/process_handle.h" 18 #include "base/process/process_handle.h"
19 #endif 19 #endif
20 20
21 #if defined(OS_MACOSX) 21 #if defined(OS_MACOSX)
22 #include "base/mac/mac_util.h" 22 #include "base/mac/mac_util.h"
23 #include "base/power_monitor/power_monitor.h" 23 #include "base/power_monitor/power_monitor_device_source.h"
24 #endif 24 #endif
25 25
26 #if defined(OS_ANDROID) 26 #if defined(OS_ANDROID)
27 #include "base/threading/thread_restrictions.h" 27 #include "base/threading/thread_restrictions.h"
28 #include "content/public/browser/browser_main_runner.h" 28 #include "content/public/browser/browser_main_runner.h"
29 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
30 #endif 30 #endif
31 31
32 namespace content { 32 namespace content {
33 namespace { 33 namespace {
(...skipping 26 matching lines...) Expand all
60 } // namespace 60 } // namespace
61 61
62 extern int BrowserMain(const MainFunctionParams&); 62 extern int BrowserMain(const MainFunctionParams&);
63 63
64 BrowserTestBase::BrowserTestBase() 64 BrowserTestBase::BrowserTestBase()
65 : embedded_test_server_( 65 : embedded_test_server_(
66 new net::test_server::EmbeddedTestServer( 66 new net::test_server::EmbeddedTestServer(
67 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))) { 67 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))) {
68 #if defined(OS_MACOSX) 68 #if defined(OS_MACOSX)
69 base::mac::SetOverrideAmIBundled(true); 69 base::mac::SetOverrideAmIBundled(true);
70 base::PowerMonitor::AllocateSystemIOPorts(); 70 base::PowerMonitorDeviceSource::AllocateSystemIOPorts();
71 #endif 71 #endif
72 72
73 #if defined(OS_POSIX) 73 #if defined(OS_POSIX)
74 handle_sigterm_ = true; 74 handle_sigterm_ = true;
75 #endif 75 #endif
76 } 76 }
77 77
78 BrowserTestBase::~BrowserTestBase() { 78 BrowserTestBase::~BrowserTestBase() {
79 #if defined(OS_ANDROID) 79 #if defined(OS_ANDROID)
80 // RemoteTestServer can cause wait on the UI thread. 80 // RemoteTestServer can cause wait on the UI thread.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 RenderProcessHostImpl::GetInProcessRendererThreadForTesting(); 146 RenderProcessHostImpl::GetInProcessRendererThreadForTesting();
147 CHECK(renderer_loop); 147 CHECK(renderer_loop);
148 148
149 renderer_loop->PostTask( 149 renderer_loop->PostTask(
150 FROM_HERE, 150 FROM_HERE,
151 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure())); 151 base::Bind(&RunTaskOnRendererThread, task, runner->QuitClosure()));
152 runner->Run(); 152 runner->Run();
153 } 153 }
154 154
155 } // namespace content 155 } // namespace content
OLDNEW
« no previous file with comments | « content/plugin/plugin_main.cc ('k') | content/renderer/renderer_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698