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

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

Issue 14859017: [content shell] implement auto resize related WebTestDelegate interfaces (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 7 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/common/gpu/image_transport_surface.h" 9 #include "content/common/gpu/image_transport_surface.h"
10 #include "content/renderer/devtools/devtools_client.h" 10 #include "content/renderer/devtools/devtools_client.h"
11 #include "content/renderer/render_thread_impl.h" 11 #include "content/renderer/render_thread_impl.h"
12 #include "content/renderer/render_view_impl.h" 12 #include "content/renderer/render_view_impl.h"
13 #include "content/renderer/renderer_webapplicationcachehost_impl.h" 13 #include "content/renderer/renderer_webapplicationcachehost_impl.h"
14 #include "content/renderer/renderer_webkitplatformsupport_impl.h" 14 #include "content/renderer/renderer_webkitplatformsupport_impl.h"
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h" 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h"
16 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestProxy.h" 16 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web TestProxy.h"
17 17
18 #if defined(OS_WIN) && !defined(USE_AURA) 18 #if defined(OS_WIN) && !defined(USE_AURA)
19 #include "content/browser/web_contents/web_contents_drag_win.h" 19 #include "content/browser/web_contents/web_contents_drag_win.h"
20 #endif 20 #endif
21 21
22 #if defined(OS_MACOSX) 22 #if defined(OS_MACOSX)
23 #include "content/browser/renderer_host/popup_menu_helper_mac.h" 23 #include "content/browser/renderer_host/popup_menu_helper_mac.h"
24 #endif 24 #endif
25 25
26 using WebKit::WebGamepads; 26 using WebKit::WebGamepads;
27 using WebKit::WebSize;
27 using WebTestRunner::WebTestProxy; 28 using WebTestRunner::WebTestProxy;
28 using WebTestRunner::WebTestProxyBase; 29 using WebTestRunner::WebTestProxyBase;
29 30
30 namespace content { 31 namespace content {
31 32
32 namespace { 33 namespace {
33 34
34 base::LazyInstance<base::Callback<void(RenderView*, WebTestProxyBase*)> >::Leaky 35 base::LazyInstance<base::Callback<void(RenderView*, WebTestProxyBase*)> >::Leaky
35 g_callback = LAZY_INSTANCE_INITIALIZER; 36 g_callback = LAZY_INSTANCE_INITIALIZER;
36 37
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 void SetFocusAndActivate(RenderView* render_view, bool enable) { 89 void SetFocusAndActivate(RenderView* render_view, bool enable) {
89 static_cast<RenderViewImpl*>(render_view) 90 static_cast<RenderViewImpl*>(render_view)
90 ->SetFocusAndActivateForTesting(enable); 91 ->SetFocusAndActivateForTesting(enable);
91 } 92 }
92 93
93 void EnableShortCircuitSizeUpdates() { 94 void EnableShortCircuitSizeUpdates() {
94 RenderThreadImpl::current()->set_short_circuit_size_updates(true); 95 RenderThreadImpl::current()->set_short_circuit_size_updates(true);
95 } 96 }
96 97
97 void ForceResizeRenderView(RenderView* render_view, 98 void ForceResizeRenderView(RenderView* render_view,
98 const WebKit::WebSize& new_size) { 99 const WebSize& new_size) {
99 static_cast<RenderViewImpl*>(render_view)->didAutoResize(new_size); 100 static_cast<RenderViewImpl*>(render_view)->didAutoResize(new_size);
100 } 101 }
101 102
102 void DisableNavigationErrorPages() { 103 void DisableNavigationErrorPages() {
103 RenderThreadImpl::current()->set_skip_error_pages(true); 104 RenderThreadImpl::current()->set_skip_error_pages(true);
104 } 105 }
105 106
106 void SetDeviceScaleFactor(RenderView* render_view, float factor) { 107 void SetDeviceScaleFactor(RenderView* render_view, float factor) {
107 static_cast<RenderViewImpl*>(render_view) 108 static_cast<RenderViewImpl*>(render_view)
108 ->SetDeviceScaleFactorForTesting(factor); 109 ->SetDeviceScaleFactorForTesting(factor);
109 } 110 }
110 111
111 void DisableSystemDragDrop() { 112 void DisableSystemDragDrop() {
112 #if defined(OS_WIN) && !defined(USE_AURA) 113 #if defined(OS_WIN) && !defined(USE_AURA)
113 WebContentsDragWin::DisableDragDropForTesting(); 114 WebContentsDragWin::DisableDragDropForTesting();
114 #endif 115 #endif
115 } 116 }
116 117
117 void DisableModalPopupMenus() { 118 void DisableModalPopupMenus() {
118 #if defined(OS_MACOSX) 119 #if defined(OS_MACOSX)
119 PopupMenuHelper::DontShowPopupMenuForTesting(); 120 PopupMenuHelper::DontShowPopupMenuForTesting();
120 #endif 121 #endif
121 } 122 }
122 123
124 void EnableAutoResizeMode(RenderView* render_view,
125 const WebSize& min_size,
126 const WebSize& max_size) {
127 static_cast<RenderViewImpl*>(render_view)
128 ->EnableAutoResizeForTesting(min_size, max_size);
129 }
130
131 void DisableAutoResizeMode(RenderView* render_view, const WebSize& new_size) {
132 static_cast<RenderViewImpl*>(render_view)
133 ->DisableAutoResizeForTesting(new_size);
134 }
135
123 } // namespace content 136 } // namespace content
OLDNEW
« content/shell/renderer/webkit_test_runner.cc ('K') | « 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