| 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/WebFrameTestProxy.h" | 19 #include "content/shell/renderer/test_runner/web_frame_test_proxy.h" |
| 20 #include "content/shell/renderer/test_runner/WebTestProxy.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/WebDeviceMotionData.h" | 22 #include "third_party/WebKit/public/platform/WebDeviceMotionData.h" |
| 23 #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h" | 23 #include "third_party/WebKit/public/platform/WebDeviceOrientationData.h" |
| 24 #include "third_party/WebKit/public/platform/WebGamepads.h" | 24 #include "third_party/WebKit/public/platform/WebGamepads.h" |
| 25 #include "third_party/WebKit/public/web/WebHistoryItem.h" | 25 #include "third_party/WebKit/public/web/WebHistoryItem.h" |
| 26 | 26 |
| 27 #if defined(OS_MACOSX) | 27 #if defined(OS_MACOSX) |
| 28 #include "content/browser/renderer_host/popup_menu_helper_mac.h" | 28 #include "content/browser/renderer_host/popup_menu_helper_mac.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 57 ViewProxy* render_view_proxy = static_cast<ViewProxy*>(render_view); | 57 ViewProxy* render_view_proxy = static_cast<ViewProxy*>(render_view); |
| 58 return static_cast<WebTestProxyBase*>(render_view_proxy); | 58 return static_cast<WebTestProxyBase*>(render_view_proxy); |
| 59 } | 59 } |
| 60 | 60 |
| 61 RenderFrameImpl* CreateWebFrameTestProxy( | 61 RenderFrameImpl* CreateWebFrameTestProxy( |
| 62 RenderViewImpl* render_view, | 62 RenderViewImpl* render_view, |
| 63 int32 routing_id) { | 63 int32 routing_id) { |
| 64 typedef WebFrameTestProxy<RenderFrameImpl, RenderViewImpl*, int32> FrameProxy; | 64 typedef WebFrameTestProxy<RenderFrameImpl, RenderViewImpl*, int32> FrameProxy; |
| 65 | 65 |
| 66 FrameProxy* render_frame_proxy = new FrameProxy(render_view, routing_id); | 66 FrameProxy* render_frame_proxy = new FrameProxy(render_view, routing_id); |
| 67 render_frame_proxy->setBaseProxy(GetWebTestProxyBase(render_view)); | 67 render_frame_proxy->set_base_proxy(GetWebTestProxyBase(render_view)); |
| 68 | 68 |
| 69 UseMockMediaStreams(render_frame_proxy); | 69 UseMockMediaStreams(render_frame_proxy); |
| 70 | 70 |
| 71 return render_frame_proxy; | 71 return render_frame_proxy; |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace | 74 } // namespace |
| 75 | 75 |
| 76 | 76 |
| 77 void EnableWebTestProxyCreation( | 77 void EnableWebTestProxyCreation( |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 void SetFocusAndActivate(RenderView* render_view, bool enable) { | 132 void SetFocusAndActivate(RenderView* render_view, bool enable) { |
| 133 static_cast<RenderViewImpl*>(render_view)-> | 133 static_cast<RenderViewImpl*>(render_view)-> |
| 134 SetFocusAndActivateForTesting(enable); | 134 SetFocusAndActivateForTesting(enable); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void ForceResizeRenderView(RenderView* render_view, | 137 void ForceResizeRenderView(RenderView* render_view, |
| 138 const WebSize& new_size) { | 138 const WebSize& new_size) { |
| 139 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view); | 139 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view); |
| 140 render_view_impl->ForceResizeForTesting(new_size); | 140 render_view_impl->ForceResizeForTesting(new_size); |
| 141 GetWebTestProxyBase(render_view_impl)->didForceResize(); | 141 GetWebTestProxyBase(render_view_impl)->DidForceResize(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void SetDeviceScaleFactor(RenderView* render_view, float factor) { | 144 void SetDeviceScaleFactor(RenderView* render_view, float factor) { |
| 145 static_cast<RenderViewImpl*>(render_view)-> | 145 static_cast<RenderViewImpl*>(render_view)-> |
| 146 SetDeviceScaleFactorForTesting(factor); | 146 SetDeviceScaleFactorForTesting(factor); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void SetDeviceColorProfile(RenderView* render_view, const std::string& name) { | 149 void SetDeviceColorProfile(RenderView* render_view, const std::string& name) { |
| 150 std::vector<char> color_profile; | 150 std::vector<char> color_profile; |
| 151 | 151 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 result.append( | 295 result.append( |
| 296 DumpHistoryItem(entry->root_history_node(), | 296 DumpHistoryItem(entry->root_history_node(), |
| 297 8, | 297 8, |
| 298 index == current_index)); | 298 index == current_index)); |
| 299 } | 299 } |
| 300 result.append("===============================================\n"); | 300 result.append("===============================================\n"); |
| 301 return result; | 301 return result; |
| 302 } | 302 } |
| 303 | 303 |
| 304 } // namespace content | 304 } // namespace content |
| OLD | NEW |