| 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" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 void SetMockDeviceMotionData(const WebDeviceMotionData& data) { | 85 void SetMockDeviceMotionData(const WebDeviceMotionData& data) { |
| 86 RendererWebKitPlatformSupportImpl::SetMockDeviceMotionDataForTesting(data); | 86 RendererWebKitPlatformSupportImpl::SetMockDeviceMotionDataForTesting(data); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void SetMockDeviceOrientationData(const WebDeviceOrientationData& data) { | 89 void SetMockDeviceOrientationData(const WebDeviceOrientationData& data) { |
| 90 RendererWebKitPlatformSupportImpl:: | 90 RendererWebKitPlatformSupportImpl:: |
| 91 SetMockDeviceOrientationDataForTesting(data); | 91 SetMockDeviceOrientationDataForTesting(data); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void EnableRendererLayoutTestMode() { | 94 void EnableRendererLayoutTestMode() { |
| 95 // We always expose GC to layout tests. |
| 96 static const char expose_gc_flag[] = "--expose-gc"; |
| 97 v8::V8::SetFlagsFromString(expose_gc_flag, sizeof(expose_gc_flag) - 1); |
| 98 |
| 95 RenderThreadImpl::current()->set_layout_test_mode(true); | 99 RenderThreadImpl::current()->set_layout_test_mode(true); |
| 96 } | 100 } |
| 97 | 101 |
| 98 void EnableBrowserLayoutTestMode() { | 102 void EnableBrowserLayoutTestMode() { |
| 99 #if defined(OS_MACOSX) | 103 #if defined(OS_MACOSX) |
| 100 ImageTransportSurface::SetAllowOSMesaForTesting(true); | 104 ImageTransportSurface::SetAllowOSMesaForTesting(true); |
| 101 PopupMenuHelper::DontShowPopupMenuForTesting(); | 105 PopupMenuHelper::DontShowPopupMenuForTesting(); |
| 102 #endif | 106 #endif |
| 103 RenderWidgetHostImpl::DisableResizeAckCheckForTesting(); | 107 RenderWidgetHostImpl::DisableResizeAckCheckForTesting(); |
| 104 } | 108 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 DisableAutoResizeForTesting(new_size); | 150 DisableAutoResizeForTesting(new_size); |
| 147 } | 151 } |
| 148 | 152 |
| 149 void UseMockMediaStreams(RenderView* render_view) { | 153 void UseMockMediaStreams(RenderView* render_view) { |
| 150 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view); | 154 RenderViewImpl* render_view_impl = static_cast<RenderViewImpl*>(render_view); |
| 151 render_view_impl->SetMediaStreamClientForTesting( | 155 render_view_impl->SetMediaStreamClientForTesting( |
| 152 new TestMediaStreamClient(render_view_impl)); | 156 new TestMediaStreamClient(render_view_impl)); |
| 153 } | 157 } |
| 154 | 158 |
| 155 } // namespace content | 159 } // namespace content |
| OLD | NEW |