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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
12 #include "cc/layers/texture_layer.h" | 12 #include "cc/layers/texture_layer.h" |
13 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" | 13 #include "third_party/WebKit/public/platform/WebScreenOrientationType.h" |
14 | 14 |
| 15 class GURL; |
| 16 |
15 namespace blink { | 17 namespace blink { |
16 class WebBatteryStatus; | 18 class WebBatteryStatus; |
17 class WebDeviceMotionData; | 19 class WebDeviceMotionData; |
18 class WebDeviceOrientationData; | 20 class WebDeviceOrientationData; |
19 class WebGamepad; | 21 class WebGamepad; |
20 class WebGamepads; | 22 class WebGamepads; |
21 class WebLayer; | 23 class WebLayer; |
22 struct WebSize; | 24 struct WebSize; |
| 25 class WebView; |
| 26 class WebURLResponse; |
23 } | 27 } |
24 | 28 |
25 namespace content { | 29 namespace content { |
26 | 30 |
27 class PageState; | 31 class PageState; |
28 class RenderFrame; | 32 class RenderFrame; |
29 class RendererGamepadProvider; | 33 class RendererGamepadProvider; |
30 class RenderView; | 34 class RenderView; |
31 class WebTestProxyBase; | 35 class WebTestProxyBase; |
32 | 36 |
33 // Turn the browser process into layout test mode. | 37 // Turn the browser process into layout test mode. |
34 void EnableBrowserLayoutTestMode(); | 38 void EnableBrowserLayoutTestMode(); |
35 | 39 |
36 /////////////////////////////////////////////////////////////////////////////// | 40 /////////////////////////////////////////////////////////////////////////////// |
37 // The following methods are meant to be used from a renderer. | 41 // The following methods are meant to be used from a renderer. |
38 | 42 |
39 // Turn a renderer into layout test mode. | 43 // Turn a renderer into layout test mode. |
40 void EnableRendererLayoutTestMode(); | 44 void EnableRendererLayoutTestMode(); |
41 | 45 |
42 // Enable injecting of a WebTestProxy between WebViews and RenderViews. | 46 // Enable injecting of a WebTestProxy between WebViews and RenderViews. |
43 // |callback| is invoked with a pointer to WebTestProxyBase for each created | 47 // |callback| is invoked with a pointer to WebTestProxyBase for each created |
44 // WebTestProxy. | 48 // WebTestProxy. |
45 void EnableWebTestProxyCreation( | 49 void EnableWebTestProxyCreation( |
46 const base::Callback<void(RenderView*, WebTestProxyBase*)>& callback); | 50 const base::Callback<void(RenderView*, WebTestProxyBase*)>& callback); |
47 | 51 |
| 52 typedef base::Callback<void(const blink::WebURLResponse& response, |
| 53 const std::string& data)> FetchManifestCallback; |
| 54 void FetchManifest(blink::WebView* view, const GURL& url, |
| 55 const FetchManifestCallback&); |
| 56 |
48 // Sets gamepad provider to be used for layout tests. | 57 // Sets gamepad provider to be used for layout tests. |
49 void SetMockGamepadProvider(scoped_ptr<RendererGamepadProvider> provider); | 58 void SetMockGamepadProvider(scoped_ptr<RendererGamepadProvider> provider); |
50 | 59 |
51 // Sets a double that should be used when registering | 60 // Sets a double that should be used when registering |
52 // a listener through WebKitPlatformSupport::setDeviceLightListener(). | 61 // a listener through WebKitPlatformSupport::setDeviceLightListener(). |
53 void SetMockDeviceLightData(const double data); | 62 void SetMockDeviceLightData(const double data); |
54 | 63 |
55 // Sets WebDeviceMotionData that should be used when registering | 64 // Sets WebDeviceMotionData that should be used when registering |
56 // a listener through WebKitPlatformSupport::setDeviceMotionListener(). | 65 // a listener through WebKitPlatformSupport::setDeviceMotionListener(). |
57 void SetMockDeviceMotionData(const blink::WebDeviceMotionData& data); | 66 void SetMockDeviceMotionData(const blink::WebDeviceMotionData& data); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Provides a text dump of the contents of the given page state. | 110 // Provides a text dump of the contents of the given page state. |
102 std::string DumpBackForwardList(std::vector<PageState>& page_state, | 111 std::string DumpBackForwardList(std::vector<PageState>& page_state, |
103 size_t current_index); | 112 size_t current_index); |
104 | 113 |
105 // Instantiates WebLayerImpl for TestPlugin. | 114 // Instantiates WebLayerImpl for TestPlugin. |
106 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer); | 115 blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer); |
107 | 116 |
108 } // namespace content | 117 } // namespace content |
109 | 118 |
110 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 119 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
OLD | NEW |