Diff
Modified: trunk/Tools/ChangeLog (139874 => 139875)
--- trunk/Tools/ChangeLog 2013-01-16 13:17:25 UTC (rev 139874)
+++ trunk/Tools/ChangeLog 2013-01-16 13:50:31 UTC (rev 139875)
@@ -1,3 +1,28 @@
+2013-01-16 Dan Carney <[email protected]>
+
+ [chromium] move setMockDeviceOrientation to TestRunner library
+ https://bugs.webkit.org/show_bug.cgi?id=106895
+
+ Reviewed by Jochen Eisinger.
+
+ * DumpRenderTree/chromium/DRTTestRunner.cpp:
+ (DRTTestRunner::DRTTestRunner):
+ * DumpRenderTree/chromium/DRTTestRunner.h:
+ (DRTTestRunner):
+ * DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h:
+ (WebKit):
+ (WebTestRunner::WebTestDelegate::setDeviceOrientation):
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp:
+ (WebTestRunner::TestRunner::TestRunner):
+ (WebTestRunner::TestRunner::setMockDeviceOrientation):
+ (WebTestRunner):
+ * DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
+ (TestRunner):
+ * DumpRenderTree/chromium/WebViewHost.cpp:
+ (WebViewHost::setDeviceOrientation):
+ * DumpRenderTree/chromium/WebViewHost.h:
+ (WebViewHost):
+
2013-01-16 Jochen Eisinger <[email protected]>
[chromium] route more webkit_support and webviewhost callbacks through WebTestDelegate
Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp (139874 => 139875)
--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp 2013-01-16 13:17:25 UTC (rev 139874)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.cpp 2013-01-16 13:50:31 UTC (rev 139875)
@@ -41,8 +41,6 @@
#include "WebAnimationController.h"
#include "WebBindings.h"
#include "WebConsoleMessage.h"
-#include "WebDeviceOrientation.h"
-#include "WebDeviceOrientationClientMock.h"
#include "WebDocument.h"
#include "WebElement.h"
#include "WebFindOptions.h"
@@ -125,7 +123,6 @@
bindMethod("setCloseRemainingWindowsWhenComplete", &DRTTestRunner::setCloseRemainingWindowsWhenComplete);
bindMethod("setCustomPolicyDelegate", &DRTTestRunner::setCustomPolicyDelegate);
bindMethod("setGeolocationPermission", &DRTTestRunner::setGeolocationPermission);
- bindMethod("setMockDeviceOrientation", &DRTTestRunner::setMockDeviceOrientation);
bindMethod("setMockGeolocationPositionUnavailableError", &DRTTestRunner::setMockGeolocationPositionUnavailableError);
bindMethod("setMockGeolocationPosition", &DRTTestRunner::setMockGeolocationPosition);
#if ENABLE(POINTER_LOCK)
@@ -525,27 +522,6 @@
result->set(numberOfRequests);
}
-void DRTTestRunner::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result)
-{
- 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;
-
- WebDeviceOrientation orientation;
- orientation.setNull(false);
- if (arguments[0].toBoolean())
- orientation.setAlpha(arguments[1].toDouble());
- if (arguments[2].toBoolean())
- orientation.setBeta(arguments[3].toDouble());
- if (arguments[4].toBoolean())
- orientation.setGamma(arguments[5].toDouble());
-
- // Note that we only call setOrientation on the main page's mock since this is all that the
- // tests require. If necessary, we could get a list of WebViewHosts from the TestShell and
- // call setOrientation on each DeviceOrientationClientMock.
- m_shell->webViewHost()->deviceOrientationClientMock()->setOrientation(orientation);
-}
-
// FIXME: For greater test flexibility, we should be able to set each page's geolocation mock individually.
// https://bugs.webkit.org/show_bug.cgi?id=52368
void DRTTestRunner::setGeolocationPermission(const CppArgumentList& arguments, CppVariant* result)
Modified: trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h (139874 => 139875)
--- trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h 2013-01-16 13:17:25 UTC (rev 139874)
+++ trunk/Tools/DumpRenderTree/chromium/DRTTestRunner.h 2013-01-16 13:50:31 UTC (rev 139875)
@@ -124,9 +124,6 @@
// Gets the number of geolocation permissions requests pending.
void numberOfPendingGeolocationPermissionRequests(const CppArgumentList&, CppVariant*);
- // DeviceOrientation related functions
- void setMockDeviceOrientation(const CppArgumentList&, CppVariant*);
-
// Geolocation related functions.
void setGeolocationPermission(const CppArgumentList&, CppVariant*);
void setMockGeolocationPosition(const CppArgumentList&, CppVariant*);
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h (139874 => 139875)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h 2013-01-16 13:17:25 UTC (rev 139874)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/public/WebTestDelegate.h 2013-01-16 13:50:31 UTC (rev 139875)
@@ -37,6 +37,7 @@
#include <string>
namespace WebKit {
+class WebDeviceOrientation;
class WebGamepads;
class WebIntentRequest;
struct WebContextMenuData;
@@ -92,6 +93,7 @@
virtual void setAcceptAllCookies(bool) { }
virtual std::string pathToLocalResource(const std::string& resource) { return std::string(); }
virtual void setLocale(const std::string&) { }
+ virtual void setDeviceOrientation(WebKit::WebDeviceOrientation&) { }
};
}
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp (139874 => 139875)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp 2013-01-16 13:17:25 UTC (rev 139874)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.cpp 2013-01-16 13:50:31 UTC (rev 139875)
@@ -34,6 +34,7 @@
#include "WebAnimationController.h"
#include "WebBindings.h"
+#include "WebDeviceOrientation.h"
#include "WebDocument.h"
#include "WebElement.h"
#include "WebFindOptions.h"
@@ -144,6 +145,7 @@
bindMethod("enableAutoResizeMode", &TestRunner::enableAutoResizeMode);
bindMethod("setSmartInsertDeleteEnabled", &TestRunner::setSmartInsertDeleteEnabled);
bindMethod("setSelectTrailingWhitespaceEnabled", &TestRunner::setSelectTrailingWhitespaceEnabled);
+ bindMethod("setMockDeviceOrientation", &TestRunner::setMockDeviceOrientation);
// The following modify WebPreferences.
bindMethod("setUserStyleSheetEnabled", &TestRunner::setUserStyleSheetEnabled);
@@ -1106,6 +1108,27 @@
result->set(true);
}
+void TestRunner::setMockDeviceOrientation(const CppArgumentList& arguments, CppVariant* result)
+{
+ 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;
+
+ WebDeviceOrientation orientation;
+ orientation.setNull(false);
+ if (arguments[0].toBoolean())
+ orientation.setAlpha(arguments[1].toDouble());
+ if (arguments[2].toBoolean())
+ orientation.setBeta(arguments[3].toDouble());
+ if (arguments[4].toBoolean())
+ orientation.setGamma(arguments[5].toDouble());
+
+ // Note that we only call setOrientation on the main page's mock since this is all that the
+ // tests require. If necessary, we could get a list of WebViewHosts from the TestShell and
+ // call setOrientation on each DeviceOrientationClientMock.
+ m_delegate->setDeviceOrientation(orientation);
+}
+
void TestRunner::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result)
{
if (arguments.size() > 0 && arguments[0].isBool()) {
Modified: trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h (139874 => 139875)
--- trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h 2013-01-16 13:17:25 UTC (rev 139874)
+++ trunk/Tools/DumpRenderTree/chromium/TestRunner/src/TestRunner.h 2013-01-16 13:50:31 UTC (rev 139875)
@@ -190,6 +190,9 @@
void enableAutoResizeMode(const CppArgumentList&, CppVariant*);
void disableAutoResizeMode(const CppArgumentList&, CppVariant*);
+ // DeviceOrientation related functions
+ void setMockDeviceOrientation(const CppArgumentList&, CppVariant*);
+
///////////////////////////////////////////////////////////////////////////
// Methods modifying WebPreferences.
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (139874 => 139875)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2013-01-16 13:17:25 UTC (rev 139874)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp 2013-01-16 13:50:31 UTC (rev 139875)
@@ -1135,6 +1135,11 @@
setlocale(LC_ALL, locale.c_str());
}
+void WebViewHost::setDeviceOrientation(WebKit::WebDeviceOrientation& orientation)
+{
+ deviceOrientationClientMock()->setOrientation(orientation);
+}
+
// Public functions -----------------------------------------------------------
WebViewHost::WebViewHost(TestShell* shell)
Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.h (139874 => 139875)
--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2013-01-16 13:17:25 UTC (rev 139874)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.h 2013-01-16 13:50:31 UTC (rev 139875)
@@ -160,6 +160,7 @@
virtual void setAcceptAllCookies(bool) OVERRIDE;
virtual std::string pathToLocalResource(const std::string& url) OVERRIDE;
virtual void setLocale(const std::string&) OVERRIDE;
+ virtual void setDeviceOrientation(WebKit::WebDeviceOrientation&) OVERRIDE;
// NavigationHost
virtual bool navigate(const TestNavigationEntry&, bool reload);