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/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/WebDeviceMotionList
ener.h" |
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebGamepads.h" |
16 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
TestProxy.h" | 17 #include "third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner/public/Web
TestProxy.h" |
17 | 18 |
18 #if defined(OS_WIN) && !defined(USE_AURA) | 19 #if defined(OS_WIN) && !defined(USE_AURA) |
19 #include "content/browser/web_contents/web_contents_drag_win.h" | 20 #include "content/browser/web_contents/web_contents_drag_win.h" |
20 #endif | 21 #endif |
21 | 22 |
22 #if defined(OS_MACOSX) | 23 #if defined(OS_MACOSX) |
23 #include "content/browser/renderer_host/popup_menu_helper_mac.h" | 24 #include "content/browser/renderer_host/popup_menu_helper_mac.h" |
24 #endif | 25 #endif |
25 | 26 |
| 27 using WebKit::WebDeviceMotionListener; |
26 using WebKit::WebGamepads; | 28 using WebKit::WebGamepads; |
27 using WebTestRunner::WebTestProxy; | 29 using WebTestRunner::WebTestProxy; |
28 using WebTestRunner::WebTestProxyBase; | 30 using WebTestRunner::WebTestProxyBase; |
29 | 31 |
30 namespace content { | 32 namespace content { |
31 | 33 |
32 namespace { | 34 namespace { |
33 | 35 |
34 base::LazyInstance<base::Callback<void(RenderView*, WebTestProxyBase*)> >::Leaky | 36 base::LazyInstance<base::Callback<void(RenderView*, WebTestProxyBase*)> >::Leaky |
35 g_callback = LAZY_INSTANCE_INITIALIZER; | 37 g_callback = LAZY_INSTANCE_INITIALIZER; |
(...skipping 15 matching lines...) Expand all Loading... |
51 void EnableWebTestProxyCreation( | 53 void EnableWebTestProxyCreation( |
52 const base::Callback<void(RenderView*, WebTestProxyBase*)>& callback) { | 54 const base::Callback<void(RenderView*, WebTestProxyBase*)>& callback) { |
53 g_callback.Get() = callback; | 55 g_callback.Get() = callback; |
54 RenderViewImpl::InstallCreateHook(CreateWebTestProxy); | 56 RenderViewImpl::InstallCreateHook(CreateWebTestProxy); |
55 } | 57 } |
56 | 58 |
57 void SetMockGamepads(const WebGamepads& pads) { | 59 void SetMockGamepads(const WebGamepads& pads) { |
58 RendererWebKitPlatformSupportImpl::SetMockGamepadsForTesting(pads); | 60 RendererWebKitPlatformSupportImpl::SetMockGamepadsForTesting(pads); |
59 } | 61 } |
60 | 62 |
| 63 void SetMockDeviceMotionListener(WebDeviceMotionListener* listener) { |
| 64 RendererWebKitPlatformSupportImpl::SetMockDeviceMotionListenerForTesting( |
| 65 listener); |
| 66 } |
| 67 |
61 void DisableAppCacheLogging() { | 68 void DisableAppCacheLogging() { |
62 RendererWebApplicationCacheHostImpl::DisableLoggingForTesting(); | 69 RendererWebApplicationCacheHostImpl::DisableLoggingForTesting(); |
63 } | 70 } |
64 | 71 |
65 void EnableDevToolsFrontendTesting() { | 72 void EnableDevToolsFrontendTesting() { |
66 DevToolsClient::EnableDevToolsFrontendTesting(); | 73 DevToolsClient::EnableDevToolsFrontendTesting(); |
67 } | 74 } |
68 | 75 |
69 int GetLocalSessionHistoryLength(RenderView* render_view) { | 76 int GetLocalSessionHistoryLength(RenderView* render_view) { |
70 return static_cast<RenderViewImpl*>(render_view) | 77 return static_cast<RenderViewImpl*>(render_view) |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 #endif | 121 #endif |
115 } | 122 } |
116 | 123 |
117 void DisableModalPopupMenus() { | 124 void DisableModalPopupMenus() { |
118 #if defined(OS_MACOSX) | 125 #if defined(OS_MACOSX) |
119 PopupMenuHelper::DontShowPopupMenuForTesting(); | 126 PopupMenuHelper::DontShowPopupMenuForTesting(); |
120 #endif | 127 #endif |
121 } | 128 } |
122 | 129 |
123 } // namespace content | 130 } // namespace content |
OLD | NEW |