| 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 #ifndef CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
| 6 #define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 6 #define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 15 #include "cc/layers/texture_layer.h" | 15 #include "cc/layers/texture_layer.h" |
| 16 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationType.h" | 16 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationType.h" |
| 17 | 17 |
| 18 class GURL; | 18 class GURL; |
| 19 | 19 |
| 20 namespace blink { | 20 namespace blink { |
| 21 class WebDeviceMotionData; | 21 class WebDeviceMotionData; |
| 22 class WebDeviceOrientationData; | 22 class WebDeviceOrientationData; |
| 23 class WebGamepad; | 23 class WebGamepad; |
| 24 class WebGamepads; | 24 class WebGamepads; |
| 25 class WebLayer; | 25 class WebLayer; |
| 26 struct WebSize; | 26 struct WebSize; |
| 27 class WebView; | 27 class WebView; |
| 28 class WebWidget; |
| 28 class WebURLResponse; | 29 class WebURLResponse; |
| 29 } | 30 } |
| 30 | 31 |
| 31 namespace device { | 32 namespace device { |
| 32 class BluetoothAdapter; | 33 class BluetoothAdapter; |
| 33 } | 34 } |
| 34 | 35 |
| 35 namespace test_runner { | 36 namespace test_runner { |
| 36 class WebFrameTestProxyBase; | 37 class WebFrameTestProxyBase; |
| 37 class WebViewTestProxyBase; | 38 class WebViewTestProxyBase; |
| 39 class WebWidgetTestProxyBase; |
| 38 } | 40 } |
| 39 | 41 |
| 40 namespace content { | 42 namespace content { |
| 41 | 43 |
| 42 class PageState; | 44 class PageState; |
| 43 class RenderFrame; | 45 class RenderFrame; |
| 44 class RendererGamepadProvider; | 46 class RendererGamepadProvider; |
| 45 class RenderView; | 47 class RenderView; |
| 46 | 48 |
| 47 // Turn the browser process into layout test mode. | 49 // Turn the browser process into layout test mode. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 58 // called. | 60 // called. |
| 59 test_runner::WebViewTestProxyBase* GetWebViewTestProxyBase( | 61 test_runner::WebViewTestProxyBase* GetWebViewTestProxyBase( |
| 60 RenderView* render_view); | 62 RenderView* render_view); |
| 61 | 63 |
| 62 // "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure | 64 // "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure |
| 63 // that prior to construction of |render_frame|, EnableiewTestProxyCreation | 65 // that prior to construction of |render_frame|, EnableiewTestProxyCreation |
| 64 // was called. | 66 // was called. |
| 65 test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase( | 67 test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase( |
| 66 RenderFrame* render_frame); | 68 RenderFrame* render_frame); |
| 67 | 69 |
| 68 // Enable injecting of a WebViewTestProxy between WebViews and RenderViews | 70 // Enable injecting of a WebViewTestProxy between WebViews and RenderViews, |
| 69 // and WebFrameTestProxy between WebFrames and RenderFrames. | 71 // WebWidgetTestProxy between WebWidgets and RenderWidgets and WebFrameTestProxy |
| 72 // between WebFrames and RenderFrames. |
| 70 // |view_proxy_creation_callback| is invoked after creating WebViewTestProxy. | 73 // |view_proxy_creation_callback| is invoked after creating WebViewTestProxy. |
| 74 // |widget_proxy_creation_callback| is invoked after creating |
| 75 // WebWidgetTestProxy. |
| 71 // |frame_proxy_creation_callback| is called after creating WebFrameTestProxy. | 76 // |frame_proxy_creation_callback| is called after creating WebFrameTestProxy. |
| 72 using ViewProxyCreationCallback = | 77 using ViewProxyCreationCallback = |
| 73 base::Callback<void(RenderView*, test_runner::WebViewTestProxyBase*)>; | 78 base::Callback<void(RenderView*, test_runner::WebViewTestProxyBase*)>; |
| 79 using WidgetProxyCreationCallback = |
| 80 base::Callback<void(blink::WebWidget*, |
| 81 test_runner::WebWidgetTestProxyBase*)>; |
| 74 using FrameProxyCreationCallback = | 82 using FrameProxyCreationCallback = |
| 75 base::Callback<void(RenderFrame*, test_runner::WebFrameTestProxyBase*)>; | 83 base::Callback<void(RenderFrame*, test_runner::WebFrameTestProxyBase*)>; |
| 76 void EnableWebTestProxyCreation( | 84 void EnableWebTestProxyCreation( |
| 77 const ViewProxyCreationCallback& view_proxy_creation_callback, | 85 const ViewProxyCreationCallback& view_proxy_creation_callback, |
| 86 const WidgetProxyCreationCallback& widget_proxy_creation_callback, |
| 78 const FrameProxyCreationCallback& frame_proxy_creation_callback); | 87 const FrameProxyCreationCallback& frame_proxy_creation_callback); |
| 79 | 88 |
| 80 typedef base::Callback<void(const blink::WebURLResponse& response, | 89 typedef base::Callback<void(const blink::WebURLResponse& response, |
| 81 const std::string& data)> FetchManifestCallback; | 90 const std::string& data)> FetchManifestCallback; |
| 82 void FetchManifest(blink::WebView* view, const GURL& url, | 91 void FetchManifest(blink::WebView* view, const GURL& url, |
| 83 const FetchManifestCallback&); | 92 const FetchManifestCallback&); |
| 84 | 93 |
| 85 // Sets gamepad provider to be used for layout tests. | 94 // Sets gamepad provider to be used for layout tests. |
| 86 void SetMockGamepadProvider(std::unique_ptr<RendererGamepadProvider> provider); | 95 void SetMockGamepadProvider(std::unique_ptr<RendererGamepadProvider> provider); |
| 87 | 96 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // Provides a text dump of the contents of the given page state. | 150 // Provides a text dump of the contents of the given page state. |
| 142 std::string DumpBackForwardList(std::vector<PageState>& page_state, | 151 std::string DumpBackForwardList(std::vector<PageState>& page_state, |
| 143 size_t current_index); | 152 size_t current_index); |
| 144 | 153 |
| 145 // Run all pending idle tasks immediately, and then invoke callback. | 154 // Run all pending idle tasks immediately, and then invoke callback. |
| 146 void SchedulerRunIdleTasks(const base::Closure& callback); | 155 void SchedulerRunIdleTasks(const base::Closure& callback); |
| 147 | 156 |
| 148 } // namespace content | 157 } // namespace content |
| 149 | 158 |
| 150 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 159 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
| OLD | NEW |