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

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

Issue 147973002: Move SetJavaScriptFlags() from webkit to content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changes Created 6 years, 10 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 | Annotate | Revision Log
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"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 std::string flags("--expose-gc");
97 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size()));
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() {
tfarina 2014/01/28 16:54:26 but adding --expose-gc here too, might fix content
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 }
105 109
106 int GetLocalSessionHistoryLength(RenderView* render_view) { 110 int GetLocalSessionHistoryLength(RenderView* render_view) {
107 return static_cast<RenderViewImpl*>(render_view)-> 111 return static_cast<RenderViewImpl*>(render_view)->
108 GetLocalSessionHistoryLengthForTesting(); 112 GetLocalSessionHistoryLengthForTesting();
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698