Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / public / test / layouttest_support.h
index 91a8098..f155a8c 100644 (file)
@@ -5,22 +5,34 @@
 #ifndef CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
 #define CONTENT_PUBLIC_TEST_LAYOUTTEST_SUPPORT_H_
 
+#include <string>
+#include <vector>
+
 #include "base/callback_forward.h"
+#include "cc/layers/texture_layer.h"
+#include "third_party/WebKit/public/platform/WebScreenOrientationType.h"
+
+class GURL;
 
 namespace blink {
+class WebBatteryStatus;
 class WebDeviceMotionData;
 class WebDeviceOrientationData;
+class WebGamepad;
 class WebGamepads;
+class WebLayer;
 struct WebSize;
-}
-
-namespace WebTestRunner {
-class WebTestProxyBase;
+class WebView;
+class WebURLResponse;
 }
 
 namespace content {
 
+class PageState;
+class RenderFrame;
+class RendererGamepadProvider;
 class RenderView;
+class WebTestProxyBase;
 
 // Turn the browser process into layout test mode.
 void EnableBrowserLayoutTestMode();
@@ -34,12 +46,20 @@ void EnableRendererLayoutTestMode();
 // Enable injecting of a WebTestProxy between WebViews and RenderViews.
 // |callback| is invoked with a pointer to WebTestProxyBase for each created
 // WebTestProxy.
-void EnableWebTestProxyCreation(const base::Callback<
-    void(RenderView*, WebTestRunner::WebTestProxyBase*)>& callback);
+void EnableWebTestProxyCreation(
+    const base::Callback<void(RenderView*, WebTestProxyBase*)>& callback);
 
-// Sets the WebGamepads that should be returned by
-// WebKitPlatformSupport::sampleGamepads().
-void SetMockGamepads(const blink::WebGamepads& pads);
+typedef base::Callback<void(const blink::WebURLResponse& response,
+                            const std::string& data)> FetchManifestCallback;
+void FetchManifest(blink::WebView* view, const GURL& url,
+                   const FetchManifestCallback&);
+
+// Sets gamepad provider to be used for layout tests.
+void SetMockGamepadProvider(scoped_ptr<RendererGamepadProvider> provider);
+
+// Sets a double that should be used when registering
+// a listener through WebKitPlatformSupport::setDeviceLightListener().
+void SetMockDeviceLightData(const double data);
 
 // Sets WebDeviceMotionData that should be used when registering
 // a listener through WebKitPlatformSupport::setDeviceMotionListener().
@@ -49,6 +69,9 @@ void SetMockDeviceMotionData(const blink::WebDeviceMotionData& data);
 // a listener through WebKitPlatformSupport::setDeviceOrientationListener().
 void SetMockDeviceOrientationData(const blink::WebDeviceOrientationData& data);
 
+// Notifies blink that battery status has changed.
+void MockBatteryStatusChanged(const blink::WebBatteryStatus& status);
+
 // Returns the length of the local session history of a render view.
 int GetLocalSessionHistoryLength(RenderView* render_view);
 
@@ -67,6 +90,9 @@ void ForceResizeRenderView(RenderView* render_view,
 // Set the device scale factor and force the compositor to resize.
 void SetDeviceScaleFactor(RenderView* render_view, float factor);
 
+// Set the device color profile associated with the profile |name|.
+void SetDeviceColorProfile(RenderView* render_view, const std::string& name);
+
 // Enables or disables synchronous resize mode. When enabled, all window-sizing
 // machinery is short-circuited inside the renderer. This mode is necessary for
 // some tests that were written before browsers had multi-process architecture
@@ -81,8 +107,12 @@ void EnableAutoResizeMode(RenderView* render_view,
 void DisableAutoResizeMode(RenderView* render_view,
                            const blink::WebSize& new_size);
 
-// Forces the |render_view| to use mock media streams.
-void UseMockMediaStreams(RenderView* render_view);
+// Provides a text dump of the contents of the given page state.
+std::string DumpBackForwardList(std::vector<PageState>& page_state,
+                                size_t current_index);
+
+// Instantiates WebLayerImpl for TestPlugin.
+blink::WebLayer* InstantiateWebLayer(scoped_refptr<cc::TextureLayer> layer);
 
 }  // namespace content