diff options
author | Konstantin Tokarev <annulen@yandex.ru> | 2016-08-25 19:20:41 +0300 |
---|---|---|
committer | Konstantin Tokarev <annulen@yandex.ru> | 2017-02-02 12:30:55 +0000 |
commit | 6882a04fb36642862b11efe514251d32070c3d65 (patch) | |
tree | b7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp | |
parent | ab6df191029eeeb0b0f16f127d553265659f739e (diff) | |
download | qtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz |
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp')
-rw-r--r-- | Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp b/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp deleted file mode 100644 index 6a1176356..000000000 --- a/Source/WebKit/blackberry/WebKitSupport/DumpRenderTreeSupport.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (C) 2012 Research In Motion Limited. All rights reserved. - * Copyright (C) 2012 Apple Inc. All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "config.h" -#include "DumpRenderTreeSupport.h" - -#include "DeviceOrientationClientMock.h" -#include "DeviceOrientationController.h" -#include "DeviceOrientationData.h" -#include "Frame.h" -#include "GeolocationClientMock.h" -#include "GeolocationController.h" -#include "GeolocationError.h" -#include "GeolocationPosition.h" -#include "JSCSSStyleDeclaration.h" -#include "JSElement.h" -#include "Page.h" -#include "RuntimeEnabledFeatures.h" -#include "WebPage_p.h" -#include "bindings/js/GCController.h" -#include <JavaScriptCore/APICast.h> -#include <wtf/CurrentTime.h> - -using namespace BlackBerry::WebKit; -using namespace WebCore; -using namespace JSC; - -bool DumpRenderTreeSupport::s_linksIncludedInTabChain = true; - -GeolocationClientMock* toGeolocationClientMock(GeolocationClient* client) -{ - ASSERT(isRunningDrt()); - return static_cast<GeolocationClientMock*>(client); -} - -DumpRenderTreeSupport::DumpRenderTreeSupport() -{ -} - -DumpRenderTreeSupport::~DumpRenderTreeSupport() -{ -} - -Page* DumpRenderTreeSupport::corePage(WebPage* webPage) -{ - return WebPagePrivate::core(webPage); -} - -int DumpRenderTreeSupport::javaScriptObjectsCount() -{ - return JSDOMWindowBase::commonVM()->heap.globalObjectCount(); -} - -void DumpRenderTreeSupport::garbageCollectorCollect() -{ - gcController().garbageCollectNow(); -} - -void DumpRenderTreeSupport::garbageCollectorCollectOnAlternateThread(bool waitUntilDone) -{ - gcController().garbageCollectOnAlternateThreadForDebugging(waitUntilDone); -} - -void DumpRenderTreeSupport::setLinksIncludedInFocusChain(bool enabled) -{ - s_linksIncludedInTabChain = enabled; -} - -bool DumpRenderTreeSupport::linksIncludedInFocusChain() -{ - return s_linksIncludedInTabChain; -} - -int DumpRenderTreeSupport::numberOfPendingGeolocationPermissionRequests(WebPage* webPage) -{ - GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client()); - return mockClient->numberOfPendingPermissionRequests(); -} - -void DumpRenderTreeSupport::resetGeolocationMock(WebPage* webPage) -{ - GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client()); - mockClient->reset(); -} - -void DumpRenderTreeSupport::setMockGeolocationPositionUnavailableError(WebPage* webPage, const String message) -{ - GeolocationClientMock* mockClient = static_cast<GeolocationClientMock*>(GeolocationController::from(corePage(webPage))->client()); - mockClient->setPositionUnavailableError(message); -} - -void DumpRenderTreeSupport::setMockGeolocationPermission(WebPage* webPage, bool allowed) -{ - GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client()); - mockClient->setPermission(allowed); -} - -void DumpRenderTreeSupport::setMockGeolocationPosition(WebPage* webPage, double latitude, double longitude, double accuracy, bool providesAltitude, double altitude, bool providesAltitudeAccuracy, double altitudeAccuracy, bool providesHeading, double heading, bool providesSpeed, double speed) -{ - GeolocationClientMock* mockClient = toGeolocationClientMock(GeolocationController::from(corePage(webPage))->client()); - mockClient->setPosition(GeolocationPosition::create(currentTime(), latitude, longitude, accuracy, providesAltitude, altitude, providesAltitudeAccuracy, altitudeAccuracy, providesHeading, heading, providesSpeed, speed)); -} - -void DumpRenderTreeSupport::scalePageBy(WebPage* webPage, float scaleFactor, float x, float y) -{ - corePage(webPage)->setPageScaleFactor(scaleFactor, IntPoint(x, y)); -} - -#if ENABLE(STYLE_SCOPED) -void DumpRenderTreeSupport::setStyleScopedEnabled(bool enabled) -{ - RuntimeEnabledFeatures::setStyleScopedEnabled(enabled); -} -#endif - -#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)->deviceOrientationClient()); - mockClient->setOrientation(DeviceOrientationData::create(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma)); -#endif -} |