diff options
Diffstat (limited to 'Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp')
-rw-r--r-- | Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp b/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp index ea4ac5601..eeb75fd08 100644 --- a/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp +++ b/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp @@ -21,6 +21,9 @@ #include "DumpRenderTreeSupport.h" #include "CSSComputedStyleDeclaration.h" +#include "DeviceOrientationClientMock.h" +#include "DeviceOrientationController.h" +#include "DeviceOrientationData.h" #include "Frame.h" #include "GeolocationClientMock.h" #include "GeolocationController.h" @@ -42,8 +45,8 @@ bool DumpRenderTreeSupport::s_linksIncludedInTabChain = true; GeolocationClientMock* toGeolocationClientMock(GeolocationClient* client) { - ASSERT(getenv("drtRun")); - return static_cast<GeolocationClientMock*>(client); + ASSERT(isRunningDrt()); + return static_cast<GeolocationClientMock*>(client); } DumpRenderTreeSupport::DumpRenderTreeSupport() @@ -134,3 +137,18 @@ JSValueRef DumpRenderTreeSupport::computedStyleIncludingVisitedInfo(JSContextRef return toRef(exec, toJS(exec, jsElement->globalObject(), style.get())); } +#if ENABLE(DEVICE_ORIENTATION) +DeviceOrientationClientMock* toDeviceOrientationClientMock(DeviceOrientationClient* client) +{ + return static_cast<DeviceOrientationClientMock*>(client); +} +#endif + +void DumpRenderTreeSupport::setMockDeviceOrientation(BlackBerry::WebKit::WebPage* webPage, bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma) +{ +#if ENABLE(DEVICE_ORIENTATION) + Page* page = corePage(webPage); + DeviceOrientationClientMock* mockClient = toDeviceOrientationClientMock(DeviceOrientationController::from(page)->client()); + mockClient->setOrientation(DeviceOrientationData::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)); +#endif +} |