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