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> |
(...skipping 16 matching lines...) Expand all Loading... |
27 class WebView; | 27 class WebView; |
28 class WebURLResponse; | 28 class WebURLResponse; |
29 } | 29 } |
30 | 30 |
31 namespace device { | 31 namespace device { |
32 class BluetoothAdapter; | 32 class BluetoothAdapter; |
33 } | 33 } |
34 | 34 |
35 namespace test_runner { | 35 namespace test_runner { |
36 class WebFrameTestProxyBase; | 36 class WebFrameTestProxyBase; |
37 class WebTestProxyBase; | 37 class WebViewTestProxyBase; |
38 } | 38 } |
39 | 39 |
40 namespace content { | 40 namespace content { |
41 | 41 |
42 class PageState; | 42 class PageState; |
43 class RenderFrame; | 43 class RenderFrame; |
44 class RendererGamepadProvider; | 44 class RendererGamepadProvider; |
45 class RenderView; | 45 class RenderView; |
46 | 46 |
47 // Turn the browser process into layout test mode. | 47 // Turn the browser process into layout test mode. |
48 void EnableBrowserLayoutTestMode(); | 48 void EnableBrowserLayoutTestMode(); |
49 | 49 |
50 /////////////////////////////////////////////////////////////////////////////// | 50 /////////////////////////////////////////////////////////////////////////////// |
51 // The following methods are meant to be used from a renderer. | 51 // The following methods are meant to be used from a renderer. |
52 | 52 |
53 // Turn a renderer into layout test mode. | 53 // Turn a renderer into layout test mode. |
54 void EnableRendererLayoutTestMode(); | 54 void EnableRendererLayoutTestMode(); |
55 | 55 |
56 // "Casts" |render_view| to |WebTestProxyBase|. Caller has to ensure that prior | 56 // "Casts" |render_view| to |WebViewTestProxyBase|. Caller has to ensure that |
57 // to construction of |render_view|, EnableWebTestProxyCreation was called. | 57 // prior to construction of |render_view|, EnableWebTestProxyCreation was |
58 test_runner::WebTestProxyBase* GetWebTestProxyBase(RenderView* render_view); | 58 // called. |
| 59 test_runner::WebViewTestProxyBase* GetWebViewTestProxyBase( |
| 60 RenderView* render_view); |
59 | 61 |
60 // "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure | 62 // "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure |
61 // that prior to construction of |render_frame|, EnableWebTestProxyCreation was | 63 // that prior to construction of |render_frame|, EnableiewTestProxyCreation |
62 // called. | 64 // was called. |
63 test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase( | 65 test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase( |
64 RenderFrame* render_frame); | 66 RenderFrame* render_frame); |
65 | 67 |
66 // Enable injecting of a WebTestProxy between WebViews and RenderViews | 68 // Enable injecting of a WebViewTestProxy between WebViews and RenderViews |
67 // and WebFrameTestProxy between WebFrames and RenderFrames. | 69 // and WebFrameTestProxy between WebFrames and RenderFrames. |
68 // |view_proxy_creation_callback| is invoked after creating WebTestProxy. | 70 // |view_proxy_creation_callback| is invoked after creating WebViewTestProxy. |
69 // |frame_proxy_creation_callback| is called after creating WebFrameTestProxy. | 71 // |frame_proxy_creation_callback| is called after creating WebFrameTestProxy. |
70 using ViewProxyCreationCallback = | 72 using ViewProxyCreationCallback = |
71 base::Callback<void(RenderView*, test_runner::WebTestProxyBase*)>; | 73 base::Callback<void(RenderView*, test_runner::WebViewTestProxyBase*)>; |
72 using FrameProxyCreationCallback = | 74 using FrameProxyCreationCallback = |
73 base::Callback<void(RenderFrame*, test_runner::WebFrameTestProxyBase*)>; | 75 base::Callback<void(RenderFrame*, test_runner::WebFrameTestProxyBase*)>; |
74 void EnableWebTestProxyCreation( | 76 void EnableWebTestProxyCreation( |
75 const ViewProxyCreationCallback& view_proxy_creation_callback, | 77 const ViewProxyCreationCallback& view_proxy_creation_callback, |
76 const FrameProxyCreationCallback& frame_proxy_creation_callback); | 78 const FrameProxyCreationCallback& frame_proxy_creation_callback); |
77 | 79 |
78 typedef base::Callback<void(const blink::WebURLResponse& response, | 80 typedef base::Callback<void(const blink::WebURLResponse& response, |
79 const std::string& data)> FetchManifestCallback; | 81 const std::string& data)> FetchManifestCallback; |
80 void FetchManifest(blink::WebView* view, const GURL& url, | 82 void FetchManifest(blink::WebView* view, const GURL& url, |
81 const FetchManifestCallback&); | 83 const FetchManifestCallback&); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // 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. |
140 std::string DumpBackForwardList(std::vector<PageState>& page_state, | 142 std::string DumpBackForwardList(std::vector<PageState>& page_state, |
141 size_t current_index); | 143 size_t current_index); |
142 | 144 |
143 // Run all pending idle tasks immediately, and then invoke callback. | 145 // Run all pending idle tasks immediately, and then invoke callback. |
144 void SchedulerRunIdleTasks(const base::Closure& callback); | 146 void SchedulerRunIdleTasks(const base::Closure& callback); |
145 | 147 |
146 } // namespace content | 148 } // namespace content |
147 | 149 |
148 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 150 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
OLD | NEW |