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

Side by Side Diff: webkit/tools/test_shell/test_shell.cc

Issue 10959020: SystemMonitor refactoring: move power state monitor into a separate class called PowerMonitor (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Call AllocateSystemIOPorts before PowerMonitor's ctor Created 8 years, 2 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
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 #undef LOG 5 #undef LOG
6 6
7 #include "webkit/tools/test_shell/test_shell.h" 7 #include "webkit/tools/test_shell/test_shell.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" 50 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h"
51 #include "webkit/tools/test_shell/test_navigation_controller.h" 51 #include "webkit/tools/test_shell/test_navigation_controller.h"
52 #include "webkit/tools/test_shell/test_shell_devtools_agent.h" 52 #include "webkit/tools/test_shell/test_shell_devtools_agent.h"
53 #include "webkit/tools/test_shell/test_shell_devtools_client.h" 53 #include "webkit/tools/test_shell/test_shell_devtools_client.h"
54 #include "webkit/tools/test_shell/test_shell_request_context.h" 54 #include "webkit/tools/test_shell/test_shell_request_context.h"
55 #include "webkit/tools/test_shell/test_shell_switches.h" 55 #include "webkit/tools/test_shell/test_shell_switches.h"
56 #include "webkit/tools/test_shell/test_webview_delegate.h" 56 #include "webkit/tools/test_shell/test_webview_delegate.h"
57 #include "webkit/user_agent/user_agent.h" 57 #include "webkit/user_agent/user_agent.h"
58 #include "webkit/user_agent/user_agent_util.h" 58 #include "webkit/user_agent/user_agent_util.h"
59 59
60 #if defined(OS_MACOSX)
61 #include "base/power_monitor/power_monitor.h"
62 #endif
63
60 using WebKit::WebCanvas; 64 using WebKit::WebCanvas;
61 using WebKit::WebFrame; 65 using WebKit::WebFrame;
62 using WebKit::WebNavigationPolicy; 66 using WebKit::WebNavigationPolicy;
63 using WebKit::WebRect; 67 using WebKit::WebRect;
64 using WebKit::WebScriptController; 68 using WebKit::WebScriptController;
65 using WebKit::WebSize; 69 using WebKit::WebSize;
66 using WebKit::WebURLRequest; 70 using WebKit::WebURLRequest;
67 using WebKit::WebView; 71 using WebKit::WebView;
68 using webkit_glue::WebPreferences; 72 using webkit_glue::WebPreferences;
69 73
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #if defined(OS_WIN) 142 #if defined(OS_WIN)
139 default_edit_wnd_proc_(0), 143 default_edit_wnd_proc_(0),
140 #endif 144 #endif
141 test_params_(NULL), 145 test_params_(NULL),
142 is_modal_(false), 146 is_modal_(false),
143 is_loading_(false), 147 is_loading_(false),
144 allow_images_(true), 148 allow_images_(true),
145 allow_plugins_(true), 149 allow_plugins_(true),
146 allow_scripts_(true), 150 allow_scripts_(true),
147 dump_stats_table_on_exit_(false) { 151 dump_stats_table_on_exit_(false) {
152 #if defined(OS_MACOSX)
153 // This needs to happen before PowerMonitor's ctor.
154 PowerMonitor::AllocateSystemIOPorts();
Hongbo Min 2012/10/16 14:14:40 Because the TestShell indirectly has a dependency
vandebo (ex-Chrome) 2012/10/16 18:50:16 Move this down to line 165, above SetUserAgent
155 #endif
148 delegate_.reset(new TestWebViewDelegate(this)); 156 delegate_.reset(new TestWebViewDelegate(this));
149 popup_delegate_.reset(new TestWebViewDelegate(this)); 157 popup_delegate_.reset(new TestWebViewDelegate(this));
150 navigation_controller_.reset(new TestNavigationController(this)); 158 navigation_controller_.reset(new TestNavigationController(this));
151 notification_presenter_.reset(new TestNotificationPresenter(this)); 159 notification_presenter_.reset(new TestNotificationPresenter(this));
152 160
153 net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance(); 161 net::URLRequestFilter* filter = net::URLRequestFilter::GetInstance();
154 filter->AddHostnameHandler("test-shell-resource", "inspector", 162 filter->AddHostnameHandler("test-shell-resource", "inspector",
155 &URLRequestTestShellFileJob::InspectorFactory); 163 &URLRequestTestShellFileJob::InspectorFactory);
156 url_util::AddStandardScheme("test-shell-resource"); 164 url_util::AddStandardScheme("test-shell-resource");
157 webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct( 165 webkit_glue::SetUserAgent(webkit_glue::BuildUserAgentFromProduct(
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 return device_orientation_client_mock_.get(); 625 return device_orientation_client_mock_.get();
618 } 626 }
619 627
620 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { 628 WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() {
621 if (!geolocation_client_mock_.get()) { 629 if (!geolocation_client_mock_.get()) {
622 geolocation_client_mock_.reset( 630 geolocation_client_mock_.reset(
623 WebKit::WebGeolocationClientMock::create()); 631 WebKit::WebGeolocationClientMock::create());
624 } 632 }
625 return geolocation_client_mock_.get(); 633 return geolocation_client_mock_.get();
626 } 634 }
OLDNEW
« webkit/glue/dom_operations_unittest.cc ('K') | « webkit/glue/dom_operations_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698