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

Side by Side Diff: content/test/layouttest_support.cc

Issue 298263002: Battery Status API: add testing support for LayoutTests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comments Created 6 years, 6 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 | « content/shell/renderer/webkit_test_runner.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) 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 "content/public/test/layouttest_support.h" 5 #include "content/public/test/layouttest_support.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "content/browser/renderer_host/render_widget_host_impl.h" 9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/common/gpu/image_transport_surface.h" 10 #include "content/common/gpu/image_transport_surface.h"
11 #include "content/public/common/page_state.h" 11 #include "content/public/common/page_state.h"
12 #include "content/renderer/history_entry.h" 12 #include "content/renderer/history_entry.h"
13 #include "content/renderer/history_serialization.h" 13 #include "content/renderer/history_serialization.h"
14 #include "content/renderer/render_frame_impl.h" 14 #include "content/renderer/render_frame_impl.h"
15 #include "content/renderer/render_thread_impl.h" 15 #include "content/renderer/render_thread_impl.h"
16 #include "content/renderer/render_view_impl.h" 16 #include "content/renderer/render_view_impl.h"
17 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 17 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
18 #include "content/shell/renderer/test_runner/TestCommon.h" 18 #include "content/shell/renderer/test_runner/TestCommon.h"
19 #include "content/shell/renderer/test_runner/web_frame_test_proxy.h" 19 #include "content/shell/renderer/test_runner/web_frame_test_proxy.h"
20 #include "content/shell/renderer/test_runner/web_test_proxy.h" 20 #include "content/shell/renderer/test_runner/web_test_proxy.h"
21 #include "third_party/WebKit/public/platform/WebBatteryStatus.h"
21 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h" 22 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h"
22 #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h" 23 #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h"
23 #include "third_party/WebKit/public/platform/WebGamepads.h" 24 #include "third_party/WebKit/public/platform/WebGamepads.h"
24 #include "third_party/WebKit/public/web/WebHistoryItem.h" 25 #include "third_party/WebKit/public/web/WebHistoryItem.h"
25 26
26 #if defined(OS_MACOSX) 27 #if defined(OS_MACOSX)
27 #include "content/browser/renderer_host/popup_menu_helper_mac.h" 28 #include "content/browser/renderer_host/popup_menu_helper_mac.h"
28 #endif 29 #endif
29 30
31 using blink::WebBatteryStatus;
30 using blink::WebDeviceMotionData; 32 using blink::WebDeviceMotionData;
31 using blink::WebDeviceOrientationData; 33 using blink::WebDeviceOrientationData;
32 using blink::WebGamepad; 34 using blink::WebGamepad;
33 using blink::WebGamepads; 35 using blink::WebGamepads;
34 using blink::WebRect; 36 using blink::WebRect;
35 using blink::WebSize; 37 using blink::WebSize;
36 38
37 namespace content { 39 namespace content {
38 40
39 namespace { 41 namespace {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // FIXME(ostap): Remove this when blink side gets updated. 109 // FIXME(ostap): Remove this when blink side gets updated.
108 RendererWebKitPlatformSupportImpl:: 110 RendererWebKitPlatformSupportImpl::
109 SetMockScreenOrientationForTesting(orientation); 111 SetMockScreenOrientationForTesting(orientation);
110 } 112 }
111 113
112 void ResetMockScreenOrientation() 114 void ResetMockScreenOrientation()
113 { 115 {
114 RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationForTesting(); 116 RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationForTesting();
115 } 117 }
116 118
119 void MockBatteryStatusChanged(const WebBatteryStatus& status) {
120 RendererWebKitPlatformSupportImpl::MockBatteryStatusChangedForTesting(status);
121 }
122
117 void EnableRendererLayoutTestMode() { 123 void EnableRendererLayoutTestMode() {
118 RenderThreadImpl::current()->set_layout_test_mode(true); 124 RenderThreadImpl::current()->set_layout_test_mode(true);
119 } 125 }
120 126
121 void EnableBrowserLayoutTestMode() { 127 void EnableBrowserLayoutTestMode() {
122 #if defined(OS_MACOSX) 128 #if defined(OS_MACOSX)
123 ImageTransportSurface::SetAllowOSMesaForTesting(true); 129 ImageTransportSurface::SetAllowOSMesaForTesting(true);
124 PopupMenuHelper::DontShowPopupMenuForTesting(); 130 PopupMenuHelper::DontShowPopupMenuForTesting();
125 #endif 131 #endif
126 RenderWidgetHostImpl::DisableResizeAckCheckForTesting(); 132 RenderWidgetHostImpl::DisableResizeAckCheckForTesting();
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 result.append( 299 result.append(
294 DumpHistoryItem(entry->root_history_node(), 300 DumpHistoryItem(entry->root_history_node(),
295 8, 301 8,
296 index == current_index)); 302 index == current_index));
297 } 303 }
298 result.append("===============================================\n"); 304 result.append("===============================================\n");
299 return result; 305 return result;
300 } 306 }
301 307
302 } // namespace content 308 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/webkit_test_runner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698