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

Side by Side Diff: content/public/test/layouttest_support.h

Issue 2174663005: Add WebWidgetTestProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
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 #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;
48 class RenderWidget;
46 49
47 // Turn the browser process into layout test mode. 50 // Turn the browser process into layout test mode.
48 void EnableBrowserLayoutTestMode(); 51 void EnableBrowserLayoutTestMode();
49 52
50 /////////////////////////////////////////////////////////////////////////////// 53 ///////////////////////////////////////////////////////////////////////////////
51 // The following methods are meant to be used from a renderer. 54 // The following methods are meant to be used from a renderer.
52 55
53 // Turn a renderer into layout test mode. 56 // Turn a renderer into layout test mode.
54 void EnableRendererLayoutTestMode(); 57 void EnableRendererLayoutTestMode();
55 58
56 // "Casts" |render_view| to |WebViewTestProxyBase|. Caller has to ensure that 59 // "Casts" |render_view| to |WebViewTestProxyBase|. Caller has to ensure that
57 // prior to construction of |render_view|, EnableWebTestProxyCreation was 60 // prior to construction of |render_view|, EnableWebTestProxyCreation was
58 // called. 61 // called.
59 test_runner::WebViewTestProxyBase* GetWebViewTestProxyBase( 62 test_runner::WebViewTestProxyBase* GetWebViewTestProxyBase(
60 RenderView* render_view); 63 RenderView* render_view);
61 64
62 // "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure 65 // "Casts" |render_frame| to |WebFrameTestProxyBase|. Caller has to ensure
63 // that prior to construction of |render_frame|, EnableiewTestProxyCreation 66 // that prior to construction of |render_frame|, EnableiewTestProxyCreation
64 // was called. 67 // was called.
65 test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase( 68 test_runner::WebFrameTestProxyBase* GetWebFrameTestProxyBase(
66 RenderFrame* render_frame); 69 RenderFrame* render_frame);
67 70
68 // Enable injecting of a WebViewTestProxy between WebViews and RenderViews 71 // Enable injecting of a WebViewTestProxy between WebViews and RenderViews,
69 // and WebFrameTestProxy between WebFrames and RenderFrames. 72 // WebWidgets and RenderWidgets and WebFrameTestProxy between WebFrames and
Łukasz Anforowicz 2016/08/02 20:38:12 s/WebWidgets and RenderWidgets/WebWidgetTestProxy
lfg 2016/08/02 22:27:21 Done.
73 // RenderFrames.
70 // |view_proxy_creation_callback| is invoked after creating WebViewTestProxy. 74 // |view_proxy_creation_callback| is invoked after creating WebViewTestProxy.
75 // |widget_proxy_creation_callback| is invoked after creating
76 // WebWidgetTestProxy.
71 // |frame_proxy_creation_callback| is called after creating WebFrameTestProxy. 77 // |frame_proxy_creation_callback| is called after creating WebFrameTestProxy.
72 using ViewProxyCreationCallback = 78 using ViewProxyCreationCallback =
73 base::Callback<void(RenderView*, test_runner::WebViewTestProxyBase*)>; 79 base::Callback<void(RenderView*, test_runner::WebViewTestProxyBase*)>;
80 using WidgetProxyCreationCallback =
81 base::Callback<void(blink::WebWidget*,
82 test_runner::WebWidgetTestProxyBase*)>;
74 using FrameProxyCreationCallback = 83 using FrameProxyCreationCallback =
75 base::Callback<void(RenderFrame*, test_runner::WebFrameTestProxyBase*)>; 84 base::Callback<void(RenderFrame*, test_runner::WebFrameTestProxyBase*)>;
76 void EnableWebTestProxyCreation( 85 void EnableWebTestProxyCreation(
77 const ViewProxyCreationCallback& view_proxy_creation_callback, 86 const ViewProxyCreationCallback& view_proxy_creation_callback,
87 const WidgetProxyCreationCallback& widget_proxy_creation_callback,
78 const FrameProxyCreationCallback& frame_proxy_creation_callback); 88 const FrameProxyCreationCallback& frame_proxy_creation_callback);
79 89
80 typedef base::Callback<void(const blink::WebURLResponse& response, 90 typedef base::Callback<void(const blink::WebURLResponse& response,
81 const std::string& data)> FetchManifestCallback; 91 const std::string& data)> FetchManifestCallback;
82 void FetchManifest(blink::WebView* view, const GURL& url, 92 void FetchManifest(blink::WebView* view, const GURL& url,
83 const FetchManifestCallback&); 93 const FetchManifestCallback&);
84 94
85 // Sets gamepad provider to be used for layout tests. 95 // Sets gamepad provider to be used for layout tests.
86 void SetMockGamepadProvider(std::unique_ptr<RendererGamepadProvider> provider); 96 void SetMockGamepadProvider(std::unique_ptr<RendererGamepadProvider> provider);
87 97
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // Provides a text dump of the contents of the given page state. 151 // Provides a text dump of the contents of the given page state.
142 std::string DumpBackForwardList(std::vector<PageState>& page_state, 152 std::string DumpBackForwardList(std::vector<PageState>& page_state,
143 size_t current_index); 153 size_t current_index);
144 154
145 // Run all pending idle tasks immediately, and then invoke callback. 155 // Run all pending idle tasks immediately, and then invoke callback.
146 void SchedulerRunIdleTasks(const base::Closure& callback); 156 void SchedulerRunIdleTasks(const base::Closure& callback);
147 157
148 } // namespace content 158 } // namespace content
149 159
150 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ 160 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698