Commit 5f871096 authored by hans@chromium.org's avatar hans@chromium.org
Browse files

2010-09-09 Hans Wennborg <hans@chromium.org>

        Reviewed by Jeremy Orlow.

        Hook up LayoutTestController.setMockDeviceOrientation() in Chromium DumpRenderTree.
        https://bugs.webkit.org/show_bug.cgi?id=45460

        This enables DumpRenderTree to run layout tests for DeviceOrientation.

        Also declare the LayoutTestController destructor out-of-line.
        Otherwise the implicit destructor would cause compiler errors because
        of the OwnPtr<WebKit::WebDeviceOrientationClientMock> member.

        * DumpRenderTree/chromium/LayoutTestController.cpp:
        (LayoutTestController::~LayoutTestController):
        (LayoutTestController::setMockDeviceOrientation):
        (LayoutTestController::deviceOrientationClient):
        * DumpRenderTree/chromium/LayoutTestController.h:
        * DumpRenderTree/chromium/WebViewHost.cpp:
        (WebViewHost::deviceOrientationClient):
        * DumpRenderTree/chromium/WebViewHost.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8c3d491a
2010-09-09 Hans Wennborg <hans@chromium.org>
Reviewed by Jeremy Orlow.
Hook up LayoutTestController.setMockDeviceOrientation() in Chromium DumpRenderTree.
https://bugs.webkit.org/show_bug.cgi?id=45460
This enables DumpRenderTree to run layout tests for DeviceOrientation.
Also declare the LayoutTestController destructor out-of-line.
Otherwise the implicit destructor would cause compiler errors because
of the OwnPtr<WebKit::WebDeviceOrientationClientMock> member.
* DumpRenderTree/chromium/LayoutTestController.cpp:
(LayoutTestController::~LayoutTestController):
(LayoutTestController::setMockDeviceOrientation):
(LayoutTestController::deviceOrientationClient):
* DumpRenderTree/chromium/LayoutTestController.h:
* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::deviceOrientationClient):
* DumpRenderTree/chromium/WebViewHost.h:
2010-09-09 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r67119.
......
......@@ -38,6 +38,8 @@
#include "public/WebAnimationController.h"
#include "public/WebBindings.h"
#include "public/WebConsoleMessage.h"
#include "public/WebDeviceOrientation.h"
#include "public/WebDeviceOrientationClientMock.h"
#include "public/WebDocument.h"
#include "public/WebElement.h"
#include "public/WebFrame.h"
......@@ -194,6 +196,10 @@ LayoutTestController::LayoutTestController(TestShell* shell)
bindProperty("webHistoryItemCount", &m_webHistoryItemCount);
}
LayoutTestController::~LayoutTestController()
{
}
LayoutTestController::WorkQueue::~WorkQueue()
{
reset();
......@@ -1387,8 +1393,14 @@ void LayoutTestController::setEditingBehavior(const CppArgumentList& arguments,
void LayoutTestController::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result)
{
// FIXME: Implement for DeviceOrientation layout tests.
// See https://bugs.webkit.org/show_bug.cgi?id=30335.
result->setNull();
if (arguments.size() < 6 || !arguments[0].isBool() || !arguments[1].isNumber() || !arguments[2].isBool() || !arguments[3].isNumber() || !arguments[4].isBool() || !arguments[5].isNumber())
return;
WebKit::WebDeviceOrientation orientation(arguments[0].toBoolean(), arguments[1].toDouble(), arguments[2].toBoolean(), arguments[3].toDouble(), arguments[4].toBoolean(), arguments[5].toDouble());
ASSERT(m_deviceOrientationClientMock);
m_deviceOrientationClientMock->setOrientation(orientation);
}
void LayoutTestController::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result)
......@@ -1444,3 +1456,10 @@ void LayoutTestController::markerTextForListItem(const CppArgumentList& args, Cp
else
result->set(element.document().frame()->markerTextForListItem(element).utf8());
}
WebKit::WebDeviceOrientationClient* LayoutTestController::deviceOrientationClient()
{
if (!m_deviceOrientationClientMock.get())
m_deviceOrientationClientMock.set(new WebKit::WebDeviceOrientationClientMock());
return m_deviceOrientationClientMock.get();
}
......@@ -49,6 +49,8 @@
#include <wtf/OwnPtr.h>
namespace WebKit {
class WebDeviceOrientationClient;
class WebDeviceOrientationClientMock;
class WebSpeechInputController;
class WebSpeechInputControllerMock;
class WebSpeechInputListener;
......@@ -62,6 +64,8 @@ public:
// object.
LayoutTestController(TestShell*);
~LayoutTestController();
// This function sets a flag that tells the test_shell to dump pages as
// plain text, rather than as a text representation of the renderer's state.
// It takes an optional argument, whether to dump pixels results or not.
......@@ -318,6 +322,7 @@ public:
void setWorkQueueFrozen(bool frozen) { m_workQueue.setFrozen(frozen); }
WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
WebKit::WebDeviceOrientationClient* deviceOrientationClient();
bool shouldDumpAsText() { return m_dumpAsText; }
bool shouldDumpEditingCallbacks() { return m_dumpEditingCallbacks; }
bool shouldDumpFrameLoadCallbacks() { return m_dumpFrameLoadCallbacks; }
......@@ -506,6 +511,8 @@ private:
WebKit::WebURL m_userStyleSheetLocation;
OwnPtr<WebKit::WebSpeechInputControllerMock> m_speechInputControllerMock;
OwnPtr<WebKit::WebDeviceOrientationClientMock> m_deviceOrientationClientMock;
};
#endif // LayoutTestController_h
......@@ -512,6 +512,11 @@ WebSpeechInputController* WebViewHost::speechInputController(WebKit::WebSpeechIn
return m_shell->layoutTestController()->speechInputController(listener);
}
WebKit::WebDeviceOrientationClient* WebViewHost::deviceOrientationClient()
{
return m_shell->layoutTestController()->deviceOrientationClient();
}
// WebWidgetClient -----------------------------------------------------------
void WebViewHost::didInvalidateRect(const WebRect& rect)
......
......@@ -45,6 +45,7 @@ class LayoutTestController;
class TestShell;
namespace WebKit {
class WebFrame;
class WebDeviceOrientationClient;
class WebGeolocationServiceMock;
class WebSpeechInputController;
class WebSpeechInputListener;
......@@ -130,6 +131,7 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
virtual WebKit::WebNotificationPresenter* notificationPresenter();
virtual WebKit::WebGeolocationService* geolocationService();
virtual WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient();
// WebKit::WebWidgetClient
virtual void didInvalidateRect(const WebKit::WebRect&);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment