| Index: Source/testing/runner/TestRunner.cpp
|
| diff --git a/Source/testing/runner/TestRunner.cpp b/Source/testing/runner/TestRunner.cpp
|
| index 716a66ada81b39ca3262c2abc917be1828fe6ed6..2cf75cea00d1040a30b24ffe944504f174861d26 100644
|
| --- a/Source/testing/runner/TestRunner.cpp
|
| +++ b/Source/testing/runner/TestRunner.cpp
|
| @@ -39,6 +39,7 @@
|
| #include "WebPermissions.h"
|
| #include "public/platform/WebData.h"
|
| #include "public/platform/WebDeviceMotionData.h"
|
| +#include "public/platform/WebDeviceOrientationData.h"
|
| #include "public/platform/WebPoint.h"
|
| #include "public/platform/WebURLResponse.h"
|
| #include "public/testing/WebPreferences.h"
|
| @@ -1545,22 +1546,32 @@ void TestRunner::setMockDeviceMotion(const CppArgumentList& arguments, CppVarian
|
| 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())
|
| + if (arguments.size() < 8
|
| + || !arguments[0].isBool() || !arguments[1].isNumber() // alpha
|
| + || !arguments[2].isBool() || !arguments[3].isNumber() // beta
|
| + || !arguments[4].isBool() || !arguments[5].isNumber() // gamma
|
| + || !arguments[6].isBool() || !arguments[7].isBool()) // absolute
|
| 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
|
| - // tests require. If necessary, we could get a list of WebViewHosts from th
|
| - // call setOrientation on each DeviceOrientationClientMock.
|
| - m_proxy->deviceOrientationClientMock()->setOrientation(orientation);
|
| + WebDeviceOrientationData orientation;
|
| +
|
| + // alpha
|
| + orientation.hasAlpha = arguments[0].toBoolean();
|
| + orientation.alpha = arguments[1].toDouble();
|
| +
|
| + // beta
|
| + orientation.hasBeta = arguments[2].toBoolean();
|
| + orientation.beta = arguments[3].toDouble();
|
| +
|
| + // gamma
|
| + orientation.hasGamma = arguments[4].toBoolean();
|
| + orientation.gamma = arguments[5].toDouble();
|
| +
|
| + // absolute
|
| + orientation.hasAbsolute = arguments[6].toBoolean();
|
| + orientation.absolute = arguments[7].toBoolean();
|
| +
|
| + m_delegate->setDeviceOrientationData(orientation);
|
| }
|
|
|
| void TestRunner::setUserStyleSheetEnabled(const CppArgumentList& arguments, CppVariant* result)
|
|
|