From 5466563f4b5b6b86523e3f89bb7f77e5b5270c78 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 15 Oct 2012 16:08:57 +0200 Subject: Imported WebKit commit 0dc6cd75e1d4836eaffbb520be96fac4847cc9d2 (http://svn.webkit.org/repository/webkit/trunk@131300) WebKit update which introduces the QtWebKitWidgets module that contains the WK1 widgets based API. (In fact it renames QtWebKit to QtWebKitWidgets while we're working on completing the entire split as part of https://bugs.webkit.org/show_bug.cgi?id=99314 --- Tools/DumpRenderTree/TestRunner.cpp | 44 +++++++++++++++++++++++++++---------- 1 file changed, 33 insertions(+), 11 deletions(-) (limited to 'Tools/DumpRenderTree/TestRunner.cpp') diff --git a/Tools/DumpRenderTree/TestRunner.cpp b/Tools/DumpRenderTree/TestRunner.cpp index 9f7a7c1be..fe28a2911 100644 --- a/Tools/DumpRenderTree/TestRunner.cpp +++ b/Tools/DumpRenderTree/TestRunner.cpp @@ -699,13 +699,6 @@ static JSValueRef computedStyleIncludingVisitedInfoCallback(JSContextRef context return controller->computedStyleIncludingVisitedInfo(context, arguments[0]); } -static JSValueRef layerTreeAsTextCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) -{ - // Has mac & windows implementation - TestRunner* controller = static_cast(JSObjectGetPrivate(thisObject)); - return JSValueMakeString(context, controller->layerTreeAsText().get()); -} - static JSValueRef notifyDoneCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception) { // Has mac & windows implementation @@ -1087,10 +1080,40 @@ static JSValueRef setMockGeolocationPositionCallback(JSContextRef context, JSObj if (argumentCount < 3) return JSValueMakeUndefined(context); + double latitude = JSValueToNumber(context, arguments[0], 0); + double longitude = JSValueToNumber(context, arguments[1], 0); + double accuracy = JSValueToNumber(context, arguments[2], 0); + + bool canProvideAltitude = false; + double altitude = 0.; + if (argumentCount > 3 && !JSValueIsUndefined(context, arguments[3])) { + canProvideAltitude = true; + altitude = JSValueToNumber(context, arguments[3], 0); + } + + bool canProvideAltitudeAccuracy = false; + double altitudeAccuracy = 0.; + if (argumentCount > 4 && !JSValueIsUndefined(context, arguments[4])) { + canProvideAltitudeAccuracy = true; + altitudeAccuracy = JSValueToNumber(context, arguments[4], 0); + } + + bool canProvideHeading = false; + double heading = 0.; + if (argumentCount > 5 && !JSValueIsUndefined(context, arguments[5])) { + canProvideHeading = true; + heading = JSValueToNumber(context, arguments[5], 0); + } + + bool canProvideSpeed = false; + double speed = 0.; + if (argumentCount > 6 && !JSValueIsUndefined(context, arguments[6])) { + canProvideSpeed = true; + speed = JSValueToNumber(context, arguments[6], 0); + } + TestRunner* controller = reinterpret_cast(JSObjectGetPrivate(thisObject)); - controller->setMockGeolocationPosition(JSValueToNumber(context, arguments[0], NULL), // latitude - JSValueToNumber(context, arguments[1], NULL), // longitude - JSValueToNumber(context, arguments[2], NULL)); // accuracy + controller->setMockGeolocationPosition(latitude, longitude, accuracy, canProvideAltitude, altitude, canProvideAltitudeAccuracy, altitudeAccuracy, canProvideHeading, heading, canProvideSpeed, speed); return JSValueMakeUndefined(context); } @@ -2214,7 +2237,6 @@ JSStaticFunction* TestRunner::staticFunctions() { "ignoreLegacyWebNotificationPermissionRequests", ignoreLegacyWebNotificationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "isCommandEnabled", isCommandEnabledCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "keepWebHistory", keepWebHistoryCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, - { "layerTreeAsText", layerTreeAsTextCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "numberOfPendingGeolocationPermissionRequests", numberOfPendingGeolocationPermissionRequestsCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "markerTextForListItem", markerTextForListItemCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, { "notifyDone", notifyDoneCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete }, -- cgit v1.2.1