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 "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 | 9 |
10 namespace WebKit { | 10 namespace blink { |
11 class WebDeviceMotionData; | 11 class WebDeviceMotionData; |
12 class WebDeviceOrientationData; | 12 class WebDeviceOrientationData; |
13 class WebGamepads; | 13 class WebGamepads; |
14 struct WebSize; | 14 struct WebSize; |
15 } | 15 } |
16 | 16 |
17 namespace WebTestRunner { | 17 namespace WebTestRunner { |
18 class WebTestProxyBase; | 18 class WebTestProxyBase; |
19 } | 19 } |
20 | 20 |
(...skipping 11 matching lines...) Expand all Loading... |
32 void EnableRendererLayoutTestMode(); | 32 void EnableRendererLayoutTestMode(); |
33 | 33 |
34 // Enable injecting of a WebTestProxy between WebViews and RenderViews. | 34 // Enable injecting of a WebTestProxy between WebViews and RenderViews. |
35 // |callback| is invoked with a pointer to WebTestProxyBase for each created | 35 // |callback| is invoked with a pointer to WebTestProxyBase for each created |
36 // WebTestProxy. | 36 // WebTestProxy. |
37 void EnableWebTestProxyCreation(const base::Callback< | 37 void EnableWebTestProxyCreation(const base::Callback< |
38 void(RenderView*, WebTestRunner::WebTestProxyBase*)>& callback); | 38 void(RenderView*, WebTestRunner::WebTestProxyBase*)>& callback); |
39 | 39 |
40 // Sets the WebGamepads that should be returned by | 40 // Sets the WebGamepads that should be returned by |
41 // WebKitPlatformSupport::sampleGamepads(). | 41 // WebKitPlatformSupport::sampleGamepads(). |
42 void SetMockGamepads(const WebKit::WebGamepads& pads); | 42 void SetMockGamepads(const blink::WebGamepads& pads); |
43 | 43 |
44 // Sets WebDeviceMotionData that should be used when registering | 44 // Sets WebDeviceMotionData that should be used when registering |
45 // a listener through WebKitPlatformSupport::setDeviceMotionListener(). | 45 // a listener through WebKitPlatformSupport::setDeviceMotionListener(). |
46 void SetMockDeviceMotionData(const WebKit::WebDeviceMotionData& data); | 46 void SetMockDeviceMotionData(const blink::WebDeviceMotionData& data); |
47 | 47 |
48 // Sets WebDeviceOrientationData that should be used when registering | 48 // Sets WebDeviceOrientationData that should be used when registering |
49 // a listener through WebKitPlatformSupport::setDeviceOrientationListener(). | 49 // a listener through WebKitPlatformSupport::setDeviceOrientationListener(). |
50 void SetMockDeviceOrientationData(const WebKit::WebDeviceOrientationData& data); | 50 void SetMockDeviceOrientationData(const blink::WebDeviceOrientationData& data); |
51 | 51 |
52 // Returns the length of the local session history of a render view. | 52 // Returns the length of the local session history of a render view. |
53 int GetLocalSessionHistoryLength(RenderView* render_view); | 53 int GetLocalSessionHistoryLength(RenderView* render_view); |
54 | 54 |
55 // Sync the current session history to the browser process. | 55 // Sync the current session history to the browser process. |
56 void SyncNavigationState(RenderView* render_view); | 56 void SyncNavigationState(RenderView* render_view); |
57 | 57 |
58 // Sets the focus of the render view depending on |enable|. This only overrides | 58 // Sets the focus of the render view depending on |enable|. This only overrides |
59 // the state of the renderer, and does not sync the focus to the browser | 59 // the state of the renderer, and does not sync the focus to the browser |
60 // process. | 60 // process. |
61 void SetFocusAndActivate(RenderView* render_view, bool enable); | 61 void SetFocusAndActivate(RenderView* render_view, bool enable); |
62 | 62 |
63 // Changes the window rect of the given render view. | 63 // Changes the window rect of the given render view. |
64 void ForceResizeRenderView(RenderView* render_view, | 64 void ForceResizeRenderView(RenderView* render_view, |
65 const WebKit::WebSize& new_size); | 65 const blink::WebSize& new_size); |
66 | 66 |
67 // Set the device scale factor and force the compositor to resize. | 67 // Set the device scale factor and force the compositor to resize. |
68 void SetDeviceScaleFactor(RenderView* render_view, float factor); | 68 void SetDeviceScaleFactor(RenderView* render_view, float factor); |
69 | 69 |
70 // Enables or disables synchronous resize mode. When enabled, all window-sizing | 70 // Enables or disables synchronous resize mode. When enabled, all window-sizing |
71 // machinery is short-circuited inside the renderer. This mode is necessary for | 71 // machinery is short-circuited inside the renderer. This mode is necessary for |
72 // some tests that were written before browsers had multi-process architecture | 72 // some tests that were written before browsers had multi-process architecture |
73 // and rely on window resizes to happen synchronously. | 73 // and rely on window resizes to happen synchronously. |
74 // See http://crbug.com/309760 for details. | 74 // See http://crbug.com/309760 for details. |
75 void UseSynchronousResizeMode(RenderView* render_view, bool enable); | 75 void UseSynchronousResizeMode(RenderView* render_view, bool enable); |
76 | 76 |
77 // Control auto resize mode. | 77 // Control auto resize mode. |
78 void EnableAutoResizeMode(RenderView* render_view, | 78 void EnableAutoResizeMode(RenderView* render_view, |
79 const WebKit::WebSize& min_size, | 79 const blink::WebSize& min_size, |
80 const WebKit::WebSize& max_size); | 80 const blink::WebSize& max_size); |
81 void DisableAutoResizeMode(RenderView* render_view, | 81 void DisableAutoResizeMode(RenderView* render_view, |
82 const WebKit::WebSize& new_size); | 82 const blink::WebSize& new_size); |
83 | 83 |
84 // Forces the |render_view| to use mock media streams. | 84 // Forces the |render_view| to use mock media streams. |
85 void UseMockMediaStreams(RenderView* render_view); | 85 void UseMockMediaStreams(RenderView* render_view); |
86 | 86 |
87 } // namespace content | 87 } // namespace content |
88 | 88 |
89 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ | 89 #endif // CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_ |
OLD | NEW |