Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 "content/test/test_media_stream_client.h" | 21 #include "content/test/test_media_stream_client.h" |
| 22 #include "third_party/WebKit/public/platform/WebBatteryStatus.h" | |
| 22 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h" | 23 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h" |
| 23 #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h" | 24 #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h" |
| 24 #include "third_party/WebKit/public/platform/WebGamepads.h" | 25 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 25 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 26 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
| 26 | 27 |
| 27 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
| 28 #include "content/browser/renderer_host/popup_menu_helper_mac.h" | 29 #include "content/browser/renderer_host/popup_menu_helper_mac.h" |
| 29 #endif | 30 #endif |
| 30 | 31 |
| 32 using blink::WebBatteryStatus; | |
| 31 using blink::WebDeviceMotionData; | 33 using blink::WebDeviceMotionData; |
| 32 using blink::WebDeviceOrientationData; | 34 using blink::WebDeviceOrientationData; |
| 33 using blink::WebGamepad; | 35 using blink::WebGamepad; |
| 34 using blink::WebGamepads; | 36 using blink::WebGamepads; |
| 35 using blink::WebRect; | 37 using blink::WebRect; |
| 36 using blink::WebSize; | 38 using blink::WebSize; |
| 37 | 39 |
| 38 namespace content { | 40 namespace content { |
| 39 | 41 |
| 40 namespace { | 42 namespace { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 // FIXME(ostap): Remove this when blink side gets updated. | 112 // FIXME(ostap): Remove this when blink side gets updated. |
| 111 RendererWebKitPlatformSupportImpl:: | 113 RendererWebKitPlatformSupportImpl:: |
| 112 SetMockScreenOrientationForTesting(orientation); | 114 SetMockScreenOrientationForTesting(orientation); |
| 113 } | 115 } |
| 114 | 116 |
| 115 void ResetMockScreenOrientation() | 117 void ResetMockScreenOrientation() |
| 116 { | 118 { |
| 117 RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationForTesting(); | 119 RendererWebKitPlatformSupportImpl::ResetMockScreenOrientationForTesting(); |
| 118 } | 120 } |
| 119 | 121 |
| 122 void MockBatteryStatusChanged(const WebBatteryStatus& status) { | |
| 123 RendererWebKitPlatformSupportImpl::MockBatteryStatusChanged(status); | |
|
jochen (gone - plz use gerrit)
2014/05/28 12:08:17
should the battery status be reset between tests?
timvolodine
2014/05/29 08:52:06
good point, I've added a ResetBatteryStatus method
| |
| 124 } | |
| 125 | |
| 120 void EnableRendererLayoutTestMode() { | 126 void EnableRendererLayoutTestMode() { |
| 121 RenderThreadImpl::current()->set_layout_test_mode(true); | 127 RenderThreadImpl::current()->set_layout_test_mode(true); |
| 122 } | 128 } |
| 123 | 129 |
| 124 void EnableBrowserLayoutTestMode() { | 130 void EnableBrowserLayoutTestMode() { |
| 125 #if defined(OS_MACOSX) | 131 #if defined(OS_MACOSX) |
| 126 ImageTransportSurface::SetAllowOSMesaForTesting(true); | 132 ImageTransportSurface::SetAllowOSMesaForTesting(true); |
| 127 PopupMenuHelper::DontShowPopupMenuForTesting(); | 133 PopupMenuHelper::DontShowPopupMenuForTesting(); |
| 128 #endif | 134 #endif |
| 129 RenderWidgetHostImpl::DisableResizeAckCheckForTesting(); | 135 RenderWidgetHostImpl::DisableResizeAckCheckForTesting(); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 result.append( | 309 result.append( |
| 304 DumpHistoryItem(entry->root_history_node(), | 310 DumpHistoryItem(entry->root_history_node(), |
| 305 8, | 311 8, |
| 306 index == current_index)); | 312 index == current_index)); |
| 307 } | 313 } |
| 308 result.append("===============================================\n"); | 314 result.append("===============================================\n"); |
| 309 return result; | 315 return result; |
| 310 } | 316 } |
| 311 | 317 |
| 312 } // namespace content | 318 } // namespace content |
| OLD | NEW |