haikuwebkit/Tools/WebKitTestRunner/GeolocationProviderMock.cpp

115 lines
4.5 KiB
C++
Raw Permalink Normal View History

[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
/*
[WK2] Add a WebKit2 API for Geolocation's highAccuracy https://bugs.webkit.org/show_bug.cgi?id=123786 Reviewed by Darin Adler. Source/WebKit2: This adds support for highAccuracy Geolocation with WebKit2. The key is to track which page/requester need what kind of geolocation in order to change between high and low accuracy as pages run and disappear. WebGeolocationManager and WebGeolocationManagerProxy have very similar roles but for different sources: -WebGeolocationManager tracks which live page require high accuracy geolocation. When the state changes, it forward the information to the UIProcess. -WebGeolocationManagerProxy tracks which WebContent processes needs high accuracy. * Shared/APIClientTraits.cpp: * Shared/APIClientTraits.h: * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::startUpdating): (WebKit::WebGeolocationManagerProxy::removeRequester): (WebKit::WebGeolocationManagerProxy::setEnableHighAccuracy): * UIProcess/WebGeolocationManagerProxy.h: (WebKit::WebGeolocationManagerProxy::isUpdating): (WebKit::WebGeolocationManagerProxy::isHighAccuracyEnabled): * UIProcess/WebGeolocationManagerProxy.messages.in: * UIProcess/WebGeolocationProvider.cpp: (WebKit::WebGeolocationProvider::setEnableHighAccuracy): * UIProcess/WebGeolocationProvider.h: * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::registerWebPage): (WebKit::WebGeolocationManager::unregisterWebPage): (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage): * WebProcess/Geolocation/WebGeolocationManager.h: (WebKit::WebGeolocationManager::isUpdating): (WebKit::WebGeolocationManager::isHighAccuracyEnabled): * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::setEnableHighAccuracy): Tools: Add basic testing for the Geolocation API (start, stop and change accuracy). * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/PlatformEfl.cmake: * TestWebKitAPI/PlatformGTK.cmake: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKit2/Geolocation.cpp: Added. (TestWebKitAPI::operator<<): (TestWebKitAPI::GeolocationStateTracker::~GeolocationStateTracker): (TestWebKitAPI::GeolocationStateTracker::eventsChanged): (TestWebKitAPI::GeolocationStateTracker::startUpdatingCallback): (TestWebKitAPI::GeolocationStateTracker::stopUpdatingCallback): (TestWebKitAPI::GeolocationStateTracker::setEnableHighAccuracyCallback): (TestWebKitAPI::decidePolicyForGeolocationPermissionRequestCallBack): (TestWebKitAPI::setupGeolocationProvider): (TestWebKitAPI::setupView): (TestWebKitAPI::GeolocationBasicStateTracker::GeolocationBasicStateTracker): (TestWebKitAPI::GeolocationBasicStateTracker::eventsChanged): (TestWebKitAPI::GeolocationBasicWithHighAccuracyStateTracker::GeolocationBasicWithHighAccuracyStateTracker): (TestWebKitAPI::GeolocationBasicWithHighAccuracyStateTracker::eventsChanged): (TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::GeolocationTransitionToHighAccuracyStateTracker): (TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::eventsChanged): (TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::GeolocationTransitionToLowAccuracyStateTracker): (TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::eventsChanged): (TestWebKitAPI::didFinishLoadForFrame): * TestWebKitAPI/Tests/WebKit2/geolocationGetCurrentPosition.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationGetCurrentPositionWithHighAccuracy.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationWatchPosition.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationWatchPositionWithHighAccuracy.html: Added. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): Canonical link: https://commits.webkit.org/142016@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-11-05 21:17:07 +00:00
* Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "GeolocationProviderMock.h"
[WK2] Change the remaining framework includes from WebKit2 to WebKit https://bugs.webkit.org/show_bug.cgi?id=132956 Patch by Martin Hodovan <mhodovan.u-szeged@partner.samsung.com> on 2014-05-16 Reviewed by Sam Weinig. Source/WebKit2: * NetworkProcess/unix/NetworkProcessMainUnix.cpp: * NetworkProcess/unix/NetworkProcessMainUnix.h: * PluginProcess/unix/PluginProcessMainUnix.h: * Shared/API/c/cairo/WKImageCairo.h: * Shared/API/c/cf/WKURLRequestCF.h: * Shared/API/c/cf/WKURLResponseCF.h: * Shared/API/c/efl/WKArrayEfl.cpp: * Shared/API/c/efl/WKArrayEfl.h: * UIProcess/API/C/CoordinatedGraphics/WKView.h: * UIProcess/API/C/WKBatteryManager.h: * UIProcess/API/C/WKBatteryStatus.h: * UIProcess/API/C/WKGrammarDetail.h: * UIProcess/API/C/WKTextChecker.h: * UIProcess/API/C/WKVibration.h: * UIProcess/API/C/WKViewportAttributes.h: * UIProcess/API/C/cairo/WKIconDatabaseCairo.h: * UIProcess/API/C/efl/WKAPICastEfl.h: * UIProcess/API/C/efl/WKColorPickerResultListener.h: * UIProcess/API/C/efl/WKEventEfl.h: * UIProcess/API/C/efl/WKPageEfl.h: * UIProcess/API/C/efl/WKPopupItem.h: * UIProcess/API/C/efl/WKPopupMenuListener.h: * UIProcess/API/C/efl/WKViewEfl.cpp: * UIProcess/API/C/efl/WKViewEfl.h: * UIProcess/API/C/gtk/WKFullScreenClientGtk.h: * UIProcess/API/C/gtk/WKInspectorClientGtk.h: * UIProcess/API/C/gtk/WKView.h: * UIProcess/API/C/gtk/WKViewPrivate.h: * UIProcess/API/C/soup/WKContextSoup.h: * UIProcess/API/C/soup/WKCookieManagerSoup.h: * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: * UIProcess/API/C/soup/WKSoupRequestManager.h: * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: * UIProcess/API/CoordinatedGraphics/WKCoordinatedScene.h: * UIProcess/API/cpp/efl/WKEinaSharedString.cpp: * UIProcess/API/cpp/efl/WKEinaSharedString.h: * UIProcess/API/efl/EwkView.cpp: * UIProcess/API/efl/EwkView.h: * UIProcess/API/efl/EwkViewCallbacks.h: * UIProcess/API/efl/GestureRecognizer.h: * UIProcess/API/efl/ewk_application_cache_manager_private.h: * UIProcess/API/efl/ewk_auth_request_private.h: * UIProcess/API/efl/ewk_back_forward_list_item_private.h: * UIProcess/API/efl/ewk_back_forward_list_private.h: * UIProcess/API/efl/ewk_context_menu_item.cpp: * UIProcess/API/efl/ewk_context_private.h: * UIProcess/API/efl/ewk_cookie_manager_private.h: * UIProcess/API/efl/ewk_database_manager_private.h: * UIProcess/API/efl/ewk_error_private.h: * UIProcess/API/efl/ewk_favicon_database_private.h: * UIProcess/API/efl/ewk_file_chooser_request_private.h: * UIProcess/API/efl/ewk_page_group_private.h: * UIProcess/API/efl/ewk_popup_menu_item_private.h: * UIProcess/API/efl/ewk_popup_menu_private.h: * UIProcess/API/efl/ewk_security_origin_private.h: * UIProcess/API/efl/ewk_settings_private.h: * UIProcess/API/efl/ewk_storage_manager_private.h: * UIProcess/API/efl/ewk_view.cpp: * UIProcess/API/efl/ewk_view_private.h: * UIProcess/API/efl/ewk_window_features_private.h: * UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp: * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: * UIProcess/API/gtk/WebKitDownloadClient.cpp: * UIProcess/API/gtk/WebKitPrivate.h: * UIProcess/CoordinatedGraphics/WKCoordinatedSceneAPICast.h: * UIProcess/efl/BatteryProvider.h: * UIProcess/efl/ContextHistoryClientEfl.h: * UIProcess/efl/DownloadManagerEfl.h: * UIProcess/efl/FindClientEfl.h: * UIProcess/efl/FormClientEfl.h: * UIProcess/efl/PageLoadClientEfl.h: * UIProcess/efl/PagePolicyClientEfl.h: * UIProcess/efl/PageUIClientEfl.h: * UIProcess/efl/RequestManagerClientEfl.h: * UIProcess/efl/TextCheckerClientEfl.h: * UIProcess/efl/VibrationClientEfl.h: * UIProcess/efl/ViewClientEfl.cpp: * UIProcess/efl/ViewClientEfl.h: * UIProcess/efl/WebInspectorProxyEfl.cpp: * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp: * WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp: * WebProcess/efl/SeccompFiltersWebProcessEfl.cpp: * WebProcess/efl/SeccompFiltersWebProcessEfl.h: * WebProcess/efl/WebProcessMainEfl.cpp: * WebProcess/efl/WebProcessMainEfl.h: * WebProcess/gtk/WebGtkInjectedBundleMain.cpp: * WebProcess/gtk/WebProcessMainGtk.cpp: * WebProcess/gtk/WebProcessMainGtk.h: * mac/WKPreferences.h: Tools: * MiniBrowser/MiniBrowserWebProcessPlugIn.h: * MiniBrowser/mac/AppDelegate.m: * MiniBrowser/mac/WK2BrowserWindowController.m: * TestWebKitAPI/InjectedBundleController.h: * TestWebKitAPI/InjectedBundleMain.cpp: * TestWebKitAPI/JavaScriptTest.cpp: * TestWebKitAPI/PlatformUtilities.h: * TestWebKitAPI/Tests/CustomProtocolsSyncXHRTest.mm: * TestWebKitAPI/Tests/WebKit2/CanHandleRequest.cpp: * TestWebKitAPI/Tests/WebKit2/CanHandleRequest_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/CookieManager.cpp: * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewIsActiveSetIsActive.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewIsActiveSetIsActive_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewRestoreZoomAndScrollBackForward.cpp: * TestWebKitAPI/Tests/WebKit2/CoordinatedGraphics/WKViewUserViewportToContents.cpp: * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp: * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/DidNotHandleKeyDown.cpp: * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp: * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/DownloadDecideDestinationCrash.cpp: * TestWebKitAPI/Tests/WebKit2/EphemeralSessionPushStateNoHistoryCallback.cpp: * TestWebKitAPI/Tests/WebKit2/EvaluateJavaScript.cpp: * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp: * TestWebKitAPI/Tests/WebKit2/Find.cpp: * TestWebKitAPI/Tests/WebKit2/FindMatches.mm: * TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp: * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp: * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp: * TestWebKitAPI/Tests/WebKit2/Geolocation.cpp: * TestWebKitAPI/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback.cpp: * TestWebKitAPI/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle.cpp: * TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp: * TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp: * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp: * TestWebKitAPI/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/LayoutMilestonesWithAllContentInFrame.cpp: * TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp: * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp: * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp: * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp: * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp: * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp: * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp: * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp: * TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp: * TestWebKitAPI/Tests/WebKit2/ParentFrame.cpp: * TestWebKitAPI/Tests/WebKit2/ParentFrame_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm: * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/PreventEmptyUserAgent.cpp: * TestWebKitAPI/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp: * TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp: * TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp: * TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp: * TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp: * TestWebKitAPI/Tests/WebKit2/SeccompFilters.cpp: * TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp: * TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp: * TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp: * TestWebKitAPI/Tests/WebKit2/WKStringJSString.cpp: * TestWebKitAPI/Tests/WebKit2/WebArchive.cpp: * TestWebKitAPI/Tests/WebKit2/WebArchive_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks.cpp: * TestWebKitAPI/Tests/WebKit2/efl/WKViewClientWebProcessCallbacks_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/mac/EditorCommands.mm: * TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm: * TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor_Bundle.mm: * TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp: * TestWebKitAPI/Tests/WebKit2/mac/WeakObjCPtr.mm: * TestWebKitAPI/Tests/WebKit2/win/AltKeyGeneratesWMSysCommand.cpp: * TestWebKitAPI/Tests/WebKit2/win/DoNotCopyANullCFURLResponse.cpp: * TestWebKitAPI/Tests/WebKit2/win/ResizeViewWhileHidden.cpp: * TestWebKitAPI/Tests/WebKit2/win/TranslateMessageGeneratesWMChar.cpp: * TestWebKitAPI/Tests/WebKit2/win/WMCloseCallsUIClientClose.cpp: * TestWebKitAPI/Tests/WebKit2/win/WMPrint.cpp: * TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm: * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme.mm: * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsTest.mm: * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing.mm: * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2ObjC/UserContentTest.mm: * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextGroupTest.mm: * TestWebKitAPI/Tests/WebKit2ObjC/WKBrowsingContextLoadDelegateTest.mm: * TestWebKitAPI/Tests/mac/DeviceScaleFactorOnBack.mm: * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm: * TestWebKitAPI/config.h: * TestWebKitAPI/efl/PlatformWebView.cpp: * TestWebKitAPI/mac/JavaScriptTestMac.mm: * TestWebKitAPI/mac/PlatformUtilitiesMac.mm: * TestWebKitAPI/mac/PlatformWebViewMac.mm: * TestWebKitAPI/mac/TestBrowsingContextLoadDelegate.h: * TestWebKitAPI/mac/WebKitAgnosticTest.mm: * WebKitTestRunner/EventSenderProxy.h: * WebKitTestRunner/GeolocationProviderMock.cpp: * WebKitTestRunner/GeolocationProviderMock.h: * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: * WebKitTestRunner/InjectedBundle/EventSendingController.cpp: * WebKitTestRunner/InjectedBundle/EventSendingController.h: * WebKitTestRunner/InjectedBundle/GCController.cpp: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: * WebKitTestRunner/InjectedBundle/InjectedBundle.h: * WebKitTestRunner/InjectedBundle/InjectedBundleMain.cpp: * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: * WebKitTestRunner/InjectedBundle/TestRunner.h: * WebKitTestRunner/InjectedBundle/TextInputController.cpp: * WebKitTestRunner/InjectedBundle/atk/AccessibilityControllerAtk.cpp: * WebKitTestRunner/InjectedBundle/atk/AccessibilityNotificationHandlerAtk.cpp: * WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp: * WebKitTestRunner/InjectedBundle/cocoa/InjectedBundlePageCocoa.mm: * WebKitTestRunner/InjectedBundle/ios/AccessibilityControllerIOS.mm: * WebKitTestRunner/InjectedBundle/ios/EventSenderProxyIOS.mm: * WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm: * WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm: * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: * WebKitTestRunner/PlatformWebView.h: * WebKitTestRunner/StringFunctions.h: * WebKitTestRunner/TestController.cpp: * WebKitTestRunner/TestController.h: * WebKitTestRunner/TestInvocation.cpp: * WebKitTestRunner/TestInvocation.h: * WebKitTestRunner/WebKitTestRunnerPrefix.h: * WebKitTestRunner/WebNotificationProvider.cpp: * WebKitTestRunner/WebNotificationProvider.h: * WebKitTestRunner/WorkQueueManager.cpp: * WebKitTestRunner/cairo/TestInvocationCairo.cpp: * WebKitTestRunner/cg/TestInvocationCG.cpp: * WebKitTestRunner/cocoa/CrashReporterInfo.mm: * WebKitTestRunner/config.h: * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: * WebKitTestRunner/ios/PlatformWebViewIOS.mm: * WebKitTestRunner/ios/TestControllerIOS.mm: * WebKitTestRunner/mac/EventSenderProxy.mm: * WebKitTestRunner/mac/PlatformWebViewMac.mm: * WebKitTestRunner/mac/TestControllerMac.mm: Canonical link: https://commits.webkit.org/151031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-16 08:53:19 +00:00
#include <WebKit/WKGeolocationManager.h>
[WK2] Add a WebKit2 API for Geolocation's highAccuracy https://bugs.webkit.org/show_bug.cgi?id=123786 Reviewed by Darin Adler. Source/WebKit2: This adds support for highAccuracy Geolocation with WebKit2. The key is to track which page/requester need what kind of geolocation in order to change between high and low accuracy as pages run and disappear. WebGeolocationManager and WebGeolocationManagerProxy have very similar roles but for different sources: -WebGeolocationManager tracks which live page require high accuracy geolocation. When the state changes, it forward the information to the UIProcess. -WebGeolocationManagerProxy tracks which WebContent processes needs high accuracy. * Shared/APIClientTraits.cpp: * Shared/APIClientTraits.h: * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::startUpdating): (WebKit::WebGeolocationManagerProxy::removeRequester): (WebKit::WebGeolocationManagerProxy::setEnableHighAccuracy): * UIProcess/WebGeolocationManagerProxy.h: (WebKit::WebGeolocationManagerProxy::isUpdating): (WebKit::WebGeolocationManagerProxy::isHighAccuracyEnabled): * UIProcess/WebGeolocationManagerProxy.messages.in: * UIProcess/WebGeolocationProvider.cpp: (WebKit::WebGeolocationProvider::setEnableHighAccuracy): * UIProcess/WebGeolocationProvider.h: * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::registerWebPage): (WebKit::WebGeolocationManager::unregisterWebPage): (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage): * WebProcess/Geolocation/WebGeolocationManager.h: (WebKit::WebGeolocationManager::isUpdating): (WebKit::WebGeolocationManager::isHighAccuracyEnabled): * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::setEnableHighAccuracy): Tools: Add basic testing for the Geolocation API (start, stop and change accuracy). * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/PlatformEfl.cmake: * TestWebKitAPI/PlatformGTK.cmake: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKit2/Geolocation.cpp: Added. (TestWebKitAPI::operator<<): (TestWebKitAPI::GeolocationStateTracker::~GeolocationStateTracker): (TestWebKitAPI::GeolocationStateTracker::eventsChanged): (TestWebKitAPI::GeolocationStateTracker::startUpdatingCallback): (TestWebKitAPI::GeolocationStateTracker::stopUpdatingCallback): (TestWebKitAPI::GeolocationStateTracker::setEnableHighAccuracyCallback): (TestWebKitAPI::decidePolicyForGeolocationPermissionRequestCallBack): (TestWebKitAPI::setupGeolocationProvider): (TestWebKitAPI::setupView): (TestWebKitAPI::GeolocationBasicStateTracker::GeolocationBasicStateTracker): (TestWebKitAPI::GeolocationBasicStateTracker::eventsChanged): (TestWebKitAPI::GeolocationBasicWithHighAccuracyStateTracker::GeolocationBasicWithHighAccuracyStateTracker): (TestWebKitAPI::GeolocationBasicWithHighAccuracyStateTracker::eventsChanged): (TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::GeolocationTransitionToHighAccuracyStateTracker): (TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::eventsChanged): (TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::GeolocationTransitionToLowAccuracyStateTracker): (TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::eventsChanged): (TestWebKitAPI::didFinishLoadForFrame): * TestWebKitAPI/Tests/WebKit2/geolocationGetCurrentPosition.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationGetCurrentPositionWithHighAccuracy.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationWatchPosition.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationWatchPositionWithHighAccuracy.html: Added. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): Canonical link: https://commits.webkit.org/142016@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-11-05 21:17:07 +00:00
#include <string.h>
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
#include <wtf/Assertions.h>
Remove currentTime() / currentTimeMS() https://bugs.webkit.org/show_bug.cgi?id=183052 Reviewed by Mark Lam. Source/WebCore: * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::haveSuitableCachedPosition): * dom/DOMTimeStamp.h: (WebCore::convertSecondsToDOMTimeStamp): * fileapi/File.cpp: (WebCore::File::File): (WebCore::File::lastModified const): * history/HistoryItem.cpp: (WebCore::generateSequenceNumber): * html/BaseDateAndTimeInputType.cpp: (WebCore::BaseDateAndTimeInputType::defaultValueForStepUp const): * html/DateTimeInputType.cpp: (WebCore::DateTimeInputType::defaultValueForStepUp const): * html/MonthInputType.cpp: (WebCore::MonthInputType::defaultValueForStepUp const): * html/TimeInputType.cpp: (WebCore::TimeInputType::defaultValueForStepUp const): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::willSendRequest): (WebCore::InspectorNetworkAgent::willSendWebSocketHandshakeRequest): * loader/EmptyFrameLoaderClient.h: * loader/FormSubmission.cpp: (WebCore::generateFormDataIdentifier): * loader/FrameLoader.cpp: (WebCore::FrameLoader::clientRedirected): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/NavigationScheduler.cpp: * page/History.cpp: (WebCore::History::stateObjectAdded): * page/History.h: * page/PageOverlay.cpp: (WebCore::PageOverlay::startFadeAnimation): (WebCore::PageOverlay::fadeAnimationTimerFired): * page/PageOverlay.h: * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawNativeImage): * platform/ios/LegacyTileLayerPool.h: * platform/ios/LegacyTileLayerPool.mm: (WebCore::LegacyTileLayerPool::LegacyTileLayerPool): (WebCore::LegacyTileLayerPool::addLayer): (WebCore::LegacyTileLayerPool::decayedCapacity const): (WebCore::LegacyTileLayerPool::prune): * platform/ios/SystemMemoryIOS.cpp: (WebCore::systemMemoryLevel): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: Source/WebKit: * NetworkProcess/cache/CacheStorageEngineCache.cpp: * PluginProcess/WebProcessConnection.cpp: * Shared/WebProcessCreationParameters.h: * Shared/linux/WebMemorySamplerLinux.cpp: (WebKit::WebMemorySampler::sampleWebKit const): * Shared/mac/WebMemorySampler.mac.mm: (WebKit::WebMemorySampler::sampleWebKit const): * UIProcess/API/C/WKContext.cpp: (WKContextSetPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime): * UIProcess/API/glib/IconDatabase.cpp: (WebKit::IconDatabase::setIconDataForIconURL): (WebKit::IconDatabase::synchronousLoadDecisionForIconURL): (WebKit::IconDatabase::performURLImport): * UIProcess/DrawingAreaProxyImpl.cpp: * UIProcess/Plugins/PlugInAutoStartProvider.cpp: (WebKit::expirationTimeFromNow): (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash): (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTable): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsFilteringOutEntriesAddedAfterTime): (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest): (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction): * UIProcess/Plugins/PlugInAutoStartProvider.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processDidFinishLaunching): (WebKit::WebProcessPool::startMemorySampler): (WebKit::WebProcessPool::setPlugInAutoStartOriginsFilteringOutEntriesAddedAfterTime): * UIProcess/WebProcessPool.h: * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: (API::InjectedBundle::PageLoaderClient::willPerformClientRedirectForFrame): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::willPerformClientRedirectForFrame): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchWillPerformClientRedirect): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: * WebProcess/WebProcess.cpp: (WebKit::m_webSQLiteDatabaseTracker): (WebKit::WebProcess::isPlugInAutoStartOriginHash): (WebKit::WebProcess::plugInDidStartFromOrigin): (WebKit::WebProcess::didAddPlugInAutoStartOriginHash): (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes): (WebKit::WebProcess::resetPlugInAutoStartOriginHashes): (WebKit::WebProcess::plugInDidReceiveUserInteraction): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: * WebProcess/wpe/WebProcessMainWPE.cpp: Source/WebKitLegacy/mac: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchWillPerformClientRedirect): Source/WebKitLegacy/win: * WebCoreSupport/WebFrameLoaderClient.cpp: (WebFrameLoaderClient::dispatchWillPerformClientRedirect): * WebCoreSupport/WebFrameLoaderClient.h: * WebDownload.h: * WebDownloadCFNet.cpp: (WebDownload::didStart): (WebDownload::didReceiveData): (WebDownload::didFinish): Source/WTF: This patch removes WTF::currentTime() and WTF::currentTimeMS(). We have fancy WallTime APIs. It has strong types like WallTime and Seconds, and this reduces the chance of bugs mixing doubles which represent milliseconds and seconds. * wtf/Condition.h: * wtf/CurrentTime.cpp: (WTF::currentTime): (WTF::WallTime::now): * wtf/CurrentTime.h: (WTF::currentTimeMS): Deleted. * wtf/DateMath.h: (WTF::jsCurrentTime): * wtf/ParkingLot.cpp: (WTF::ParkingLot::parkConditionallyImpl): * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: (WTF::ThreadCondition::timedWait): * wtf/ThreadingWin.cpp: (WTF::ThreadCondition::timedWait): (WTF::absoluteTimeToWaitTimeoutInterval): * wtf/WallTime.cpp: (WTF::WallTime::now): Deleted. * wtf/WallTime.h: Tools: * DumpRenderTree/TestRunner.cpp: (preciseTimeCallback): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::setMockGeolocationPosition): * TestWebKitAPI/Tests/WTF/Condition.cpp: * TestWebKitAPI/Tests/WTF/ThreadGroup.cpp: * TestWebKitAPI/Tests/WTF/WorkQueue.cpp: * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::setPosition): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::preciseTime): Canonical link: https://commits.webkit.org/198809@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228942 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-23 04:18:17 +00:00
#include <wtf/WallTime.h>
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
namespace WTR {
static void startUpdatingCallback(WKGeolocationManagerRef geolocationManager, const void* clientInfo)
{
GeolocationProviderMock* geolocationProvider = static_cast<GeolocationProviderMock*>(const_cast<void*>(clientInfo));
geolocationProvider->startUpdating(geolocationManager);
}
static void stopUpdatingCallback(WKGeolocationManagerRef geolocationManager, const void* clientInfo)
{
GeolocationProviderMock* geolocationProvider = static_cast<GeolocationProviderMock*>(const_cast<void*>(clientInfo));
geolocationProvider->stopUpdating(geolocationManager);
}
GeolocationProviderMock::GeolocationProviderMock(WKContextRef context)
: m_context(context)
, m_geolocationManager(WKContextGetGeolocationManager(context))
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
{
Deprecate all unversioned client structs in favor of having explicit versioned structs https://bugs.webkit.org/show_bug.cgi?id=125203 Reviewed by Dan Bernstein. Source/WebKit2: Deprecate all the "current version" enums and unversioned client structs. * Shared/API/c/WKConnectionRef.cpp: (WKConnectionSetConnectionClient): * Shared/API/c/WKConnectionRef.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetClient): (WKContextSetInjectedBundleClient): (WKContextSetHistoryClient): (WKContextSetDownloadClient): (WKContextSetConnectionClient): * UIProcess/API/C/WKContext.h: * UIProcess/API/C/WKContextConnectionClient.h: * UIProcess/API/C/WKContextDownloadClient.h: * UIProcess/API/C/WKContextHistoryClient.h: * UIProcess/API/C/WKContextInjectedBundleClient.h: * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerSetClient): * UIProcess/API/C/WKCookieManager.h: * UIProcess/API/C/WKDatabaseManager.cpp: (WKDatabaseManagerSetClient): * UIProcess/API/C/WKDatabaseManager.h: * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerSetProvider): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseSetIconDatabaseClient): * UIProcess/API/C/WKIconDatabase.h: * UIProcess/API/C/WKOriginDataManager.cpp: (WKOriginDataManagerSetChangeClient): * UIProcess/API/C/WKOriginDataManager.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): (WKPageSetPageFindClient): (WKPageSetPageFindMatchesClient): (WKPageSetPageFormClient): (WKPageSetPageLoaderClient): (WKPageSetPagePolicyClient): (WKPageSetPageUIClient): * UIProcess/API/C/WKPage.h: * UIProcess/API/C/WKPageContextMenuClient.h: * UIProcess/API/C/WKPageFindClient.h: * UIProcess/API/C/WKPageFindMatchesClient.h: * UIProcess/API/C/WKPageFormClient.h: * UIProcess/API/C/WKPageLoaderClient.h: * UIProcess/API/C/WKPagePolicyClient.h: * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (setUpPagePolicyClient): * UIProcess/API/Cocoa/WKConnection.mm: (setUpClient): * UIProcess/API/Cocoa/WKProcessGroup.mm: (setUpConnectionClient): (setUpInectedBundleClient): (setUpHistoryClient): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createInspectorPage): * UIProcess/WebUIClient.cpp: (WebKit::WebUIClient::createNewPage): (WebKit::WebUIClient::mouseDidMoveOverElement): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformCreateInspectorPage): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetClient): * WebProcess/InjectedBundle/API/c/WKBundle.h: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetContextMenuClient): (WKBundlePageSetEditorClient): (WKBundlePageSetFormClient): (WKBundlePageSetPageLoaderClient): (WKBundlePageSetResourceLoadClient): (WKBundlePageSetPolicyClient): (WKBundlePageSetUIClient): (WKBundlePageSetFullScreenClient): (WKBundlePageSetDiagnosticLoggingClient): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h: * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: (WKBundlePageOverlayCreate): (WKBundlePageOverlaySetAccessibilityClient): * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h: * WebProcess/InjectedBundle/API/c/WKBundlePagePolicyClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageResourceLoadClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h: * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h: * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm: (WKBundlePageBannerCreateBannerWithCALayer): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm: (setUpBundleClient): Tools: Update for WebKit2 API changes. * MiniBrowser/mac/AppDelegate.m: (-[BrowserAppDelegate init]): * MiniBrowser/mac/WK2BrowserWindowController.m: (-[WK2BrowserWindowController awakeFromNib]): * TestWebKitAPI/InjectedBundleController.cpp: (TestWebKitAPI::InjectedBundleController::initialize): * TestWebKitAPI/Tests/WebKit2/AboutBlankLoad.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/CanHandleRequest.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/CloseThenTerminate.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/CookieManager.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionBasic::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionNoCache::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp: (TestWebKitAPI::DidAssociateFormControlsTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DidNotHandleKeyDown.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DownloadDecideDestinationCrash.cpp: (TestWebKitAPI::setContextDownloadClient): (TestWebKitAPI::setPagePolicyClient): * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/Find.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FindMatches.mm: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/Geolocation.cpp: (TestWebKitAPI::setupGeolocationProvider): (TestWebKitAPI::setupView): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle.cpp: (TestWebKitAPI::setPageLoaderClient): (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp: (TestWebKitAPI::HitTestResultNodeHandleTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp: (TestWebKitAPI::InjectedBundleFrameHitTestTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LayoutMilestonesWithAllContentInFrame.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp: (TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp: (TestWebKitAPI::WebKit2CrashLoader::WebKit2CrashLoader): * TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ParentFrame.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/ParentFrame_Bundle.cpp: (TestWebKitAPI::ParentFrameTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp: (TestWebKitAPI::PasteboardNotificationsTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly.cpp: (TestWebKitAPI::setInjectedBundleClient): (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp: (TestWebKitAPI::ShouldGoToBackForwardListItemTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/UserMessage.cpp: (TestWebKitAPI::WebKit2UserMessageRoundTripTest::setInjectedBundleClient): (TestWebKitAPI::WebKit2UserMessageRoundTripTest::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/WKConnection.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/WKConnection_Bundle.cpp: (TestWebKitAPI::WKConnectionTest::initialize): * TestWebKitAPI/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/WebArchive.cpp: (TestWebKitAPI::setInjectedBundleClient): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/WillLoad.cpp: (TestWebKitAPI::WebKit2WillLoadTest::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp: (TestWebKitAPI::WillSendSubmitEventTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/mac/EditorCommands.mm: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp: (TestWebKitAPI::DenyWillSendRequestTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2ObjC/WKRemoteObjectRegistry.mm: (TestWebKitAPI::didCreateConnection): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm: (TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView): * TestWebKitAPI/Tests/mac/WKRemoteObjectRegistry_Bundle.mm: * TestWebKitAPI/mac/WebKitAgnosticTest.mm: (TestWebKitAPI::setPageLoaderClient): * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::initialize): * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::InjectedBundlePage): * WebKitTestRunner/TestController.cpp: (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::createWebViewWithOptions): Canonical link: https://commits.webkit.org/143331@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-04 18:49:49 +00:00
WKGeolocationProviderV1 providerCallback;
memset(&providerCallback, 0, sizeof(WKGeolocationProviderV1));
Deprecate all unversioned client structs in favor of having explicit versioned structs https://bugs.webkit.org/show_bug.cgi?id=125203 Reviewed by Dan Bernstein. Source/WebKit2: Deprecate all the "current version" enums and unversioned client structs. * Shared/API/c/WKConnectionRef.cpp: (WKConnectionSetConnectionClient): * Shared/API/c/WKConnectionRef.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetClient): (WKContextSetInjectedBundleClient): (WKContextSetHistoryClient): (WKContextSetDownloadClient): (WKContextSetConnectionClient): * UIProcess/API/C/WKContext.h: * UIProcess/API/C/WKContextConnectionClient.h: * UIProcess/API/C/WKContextDownloadClient.h: * UIProcess/API/C/WKContextHistoryClient.h: * UIProcess/API/C/WKContextInjectedBundleClient.h: * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerSetClient): * UIProcess/API/C/WKCookieManager.h: * UIProcess/API/C/WKDatabaseManager.cpp: (WKDatabaseManagerSetClient): * UIProcess/API/C/WKDatabaseManager.h: * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerSetProvider): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseSetIconDatabaseClient): * UIProcess/API/C/WKIconDatabase.h: * UIProcess/API/C/WKOriginDataManager.cpp: (WKOriginDataManagerSetChangeClient): * UIProcess/API/C/WKOriginDataManager.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): (WKPageSetPageFindClient): (WKPageSetPageFindMatchesClient): (WKPageSetPageFormClient): (WKPageSetPageLoaderClient): (WKPageSetPagePolicyClient): (WKPageSetPageUIClient): * UIProcess/API/C/WKPage.h: * UIProcess/API/C/WKPageContextMenuClient.h: * UIProcess/API/C/WKPageFindClient.h: * UIProcess/API/C/WKPageFindMatchesClient.h: * UIProcess/API/C/WKPageFormClient.h: * UIProcess/API/C/WKPageLoaderClient.h: * UIProcess/API/C/WKPagePolicyClient.h: * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (setUpPagePolicyClient): * UIProcess/API/Cocoa/WKConnection.mm: (setUpClient): * UIProcess/API/Cocoa/WKProcessGroup.mm: (setUpConnectionClient): (setUpInectedBundleClient): (setUpHistoryClient): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createInspectorPage): * UIProcess/WebUIClient.cpp: (WebKit::WebUIClient::createNewPage): (WebKit::WebUIClient::mouseDidMoveOverElement): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformCreateInspectorPage): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetClient): * WebProcess/InjectedBundle/API/c/WKBundle.h: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetContextMenuClient): (WKBundlePageSetEditorClient): (WKBundlePageSetFormClient): (WKBundlePageSetPageLoaderClient): (WKBundlePageSetResourceLoadClient): (WKBundlePageSetPolicyClient): (WKBundlePageSetUIClient): (WKBundlePageSetFullScreenClient): (WKBundlePageSetDiagnosticLoggingClient): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h: * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: (WKBundlePageOverlayCreate): (WKBundlePageOverlaySetAccessibilityClient): * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h: * WebProcess/InjectedBundle/API/c/WKBundlePagePolicyClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageResourceLoadClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h: * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h: * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm: (WKBundlePageBannerCreateBannerWithCALayer): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm: (setUpBundleClient): Tools: Update for WebKit2 API changes. * MiniBrowser/mac/AppDelegate.m: (-[BrowserAppDelegate init]): * MiniBrowser/mac/WK2BrowserWindowController.m: (-[WK2BrowserWindowController awakeFromNib]): * TestWebKitAPI/InjectedBundleController.cpp: (TestWebKitAPI::InjectedBundleController::initialize): * TestWebKitAPI/Tests/WebKit2/AboutBlankLoad.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/CanHandleRequest.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/CloseThenTerminate.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/CookieManager.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionBasic::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionNoCache::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp: (TestWebKitAPI::DidAssociateFormControlsTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DidNotHandleKeyDown.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DownloadDecideDestinationCrash.cpp: (TestWebKitAPI::setContextDownloadClient): (TestWebKitAPI::setPagePolicyClient): * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/Find.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FindMatches.mm: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/Geolocation.cpp: (TestWebKitAPI::setupGeolocationProvider): (TestWebKitAPI::setupView): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle.cpp: (TestWebKitAPI::setPageLoaderClient): (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp: (TestWebKitAPI::HitTestResultNodeHandleTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp: (TestWebKitAPI::InjectedBundleFrameHitTestTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LayoutMilestonesWithAllContentInFrame.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp: (TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp: (TestWebKitAPI::WebKit2CrashLoader::WebKit2CrashLoader): * TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ParentFrame.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/ParentFrame_Bundle.cpp: (TestWebKitAPI::ParentFrameTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp: (TestWebKitAPI::PasteboardNotificationsTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly.cpp: (TestWebKitAPI::setInjectedBundleClient): (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp: (TestWebKitAPI::ShouldGoToBackForwardListItemTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/UserMessage.cpp: (TestWebKitAPI::WebKit2UserMessageRoundTripTest::setInjectedBundleClient): (TestWebKitAPI::WebKit2UserMessageRoundTripTest::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/WKConnection.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/WKConnection_Bundle.cpp: (TestWebKitAPI::WKConnectionTest::initialize): * TestWebKitAPI/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/WebArchive.cpp: (TestWebKitAPI::setInjectedBundleClient): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/WillLoad.cpp: (TestWebKitAPI::WebKit2WillLoadTest::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp: (TestWebKitAPI::WillSendSubmitEventTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/mac/EditorCommands.mm: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp: (TestWebKitAPI::DenyWillSendRequestTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2ObjC/WKRemoteObjectRegistry.mm: (TestWebKitAPI::didCreateConnection): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm: (TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView): * TestWebKitAPI/Tests/mac/WKRemoteObjectRegistry_Bundle.mm: * TestWebKitAPI/mac/WebKitAgnosticTest.mm: (TestWebKitAPI::setPageLoaderClient): * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::initialize): * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::InjectedBundlePage): * WebKitTestRunner/TestController.cpp: (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::createWebViewWithOptions): Canonical link: https://commits.webkit.org/143331@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-04 18:49:49 +00:00
providerCallback.base.version = 1;
providerCallback.base.clientInfo = this;
[WK2] Add a WebKit2 API for Geolocation's highAccuracy https://bugs.webkit.org/show_bug.cgi?id=123786 Reviewed by Darin Adler. Source/WebKit2: This adds support for highAccuracy Geolocation with WebKit2. The key is to track which page/requester need what kind of geolocation in order to change between high and low accuracy as pages run and disappear. WebGeolocationManager and WebGeolocationManagerProxy have very similar roles but for different sources: -WebGeolocationManager tracks which live page require high accuracy geolocation. When the state changes, it forward the information to the UIProcess. -WebGeolocationManagerProxy tracks which WebContent processes needs high accuracy. * Shared/APIClientTraits.cpp: * Shared/APIClientTraits.h: * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::startUpdating): (WebKit::WebGeolocationManagerProxy::removeRequester): (WebKit::WebGeolocationManagerProxy::setEnableHighAccuracy): * UIProcess/WebGeolocationManagerProxy.h: (WebKit::WebGeolocationManagerProxy::isUpdating): (WebKit::WebGeolocationManagerProxy::isHighAccuracyEnabled): * UIProcess/WebGeolocationManagerProxy.messages.in: * UIProcess/WebGeolocationProvider.cpp: (WebKit::WebGeolocationProvider::setEnableHighAccuracy): * UIProcess/WebGeolocationProvider.h: * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::registerWebPage): (WebKit::WebGeolocationManager::unregisterWebPage): (WebKit::WebGeolocationManager::setEnableHighAccuracyForPage): * WebProcess/Geolocation/WebGeolocationManager.h: (WebKit::WebGeolocationManager::isUpdating): (WebKit::WebGeolocationManager::isHighAccuracyEnabled): * WebProcess/WebCoreSupport/WebGeolocationClient.cpp: (WebKit::WebGeolocationClient::setEnableHighAccuracy): Tools: Add basic testing for the Geolocation API (start, stop and change accuracy). * TestWebKitAPI/GNUmakefile.am: * TestWebKitAPI/PlatformEfl.cmake: * TestWebKitAPI/PlatformGTK.cmake: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKit2/Geolocation.cpp: Added. (TestWebKitAPI::operator<<): (TestWebKitAPI::GeolocationStateTracker::~GeolocationStateTracker): (TestWebKitAPI::GeolocationStateTracker::eventsChanged): (TestWebKitAPI::GeolocationStateTracker::startUpdatingCallback): (TestWebKitAPI::GeolocationStateTracker::stopUpdatingCallback): (TestWebKitAPI::GeolocationStateTracker::setEnableHighAccuracyCallback): (TestWebKitAPI::decidePolicyForGeolocationPermissionRequestCallBack): (TestWebKitAPI::setupGeolocationProvider): (TestWebKitAPI::setupView): (TestWebKitAPI::GeolocationBasicStateTracker::GeolocationBasicStateTracker): (TestWebKitAPI::GeolocationBasicStateTracker::eventsChanged): (TestWebKitAPI::GeolocationBasicWithHighAccuracyStateTracker::GeolocationBasicWithHighAccuracyStateTracker): (TestWebKitAPI::GeolocationBasicWithHighAccuracyStateTracker::eventsChanged): (TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::GeolocationTransitionToHighAccuracyStateTracker): (TestWebKitAPI::GeolocationTransitionToHighAccuracyStateTracker::eventsChanged): (TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::GeolocationTransitionToLowAccuracyStateTracker): (TestWebKitAPI::GeolocationTransitionToLowAccuracyStateTracker::eventsChanged): (TestWebKitAPI::didFinishLoadForFrame): * TestWebKitAPI/Tests/WebKit2/geolocationGetCurrentPosition.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationGetCurrentPositionWithHighAccuracy.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationWatchPosition.html: Added. * TestWebKitAPI/Tests/WebKit2/geolocationWatchPositionWithHighAccuracy.html: Added. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): Canonical link: https://commits.webkit.org/142016@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-11-05 21:17:07 +00:00
providerCallback.startUpdating = startUpdatingCallback;
providerCallback.stopUpdating = stopUpdatingCallback;
Deprecate all unversioned client structs in favor of having explicit versioned structs https://bugs.webkit.org/show_bug.cgi?id=125203 Reviewed by Dan Bernstein. Source/WebKit2: Deprecate all the "current version" enums and unversioned client structs. * Shared/API/c/WKConnectionRef.cpp: (WKConnectionSetConnectionClient): * Shared/API/c/WKConnectionRef.h: * UIProcess/API/C/WKContext.cpp: (WKContextSetClient): (WKContextSetInjectedBundleClient): (WKContextSetHistoryClient): (WKContextSetDownloadClient): (WKContextSetConnectionClient): * UIProcess/API/C/WKContext.h: * UIProcess/API/C/WKContextConnectionClient.h: * UIProcess/API/C/WKContextDownloadClient.h: * UIProcess/API/C/WKContextHistoryClient.h: * UIProcess/API/C/WKContextInjectedBundleClient.h: * UIProcess/API/C/WKCookieManager.cpp: (WKCookieManagerSetClient): * UIProcess/API/C/WKCookieManager.h: * UIProcess/API/C/WKDatabaseManager.cpp: (WKDatabaseManagerSetClient): * UIProcess/API/C/WKDatabaseManager.h: * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerSetProvider): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/API/C/WKIconDatabase.cpp: (WKIconDatabaseSetIconDatabaseClient): * UIProcess/API/C/WKIconDatabase.h: * UIProcess/API/C/WKOriginDataManager.cpp: (WKOriginDataManagerSetChangeClient): * UIProcess/API/C/WKOriginDataManager.h: * UIProcess/API/C/WKPage.cpp: (WKPageSetPageContextMenuClient): (WKPageSetPageFindClient): (WKPageSetPageFindMatchesClient): (WKPageSetPageFormClient): (WKPageSetPageLoaderClient): (WKPageSetPagePolicyClient): (WKPageSetPageUIClient): * UIProcess/API/C/WKPage.h: * UIProcess/API/C/WKPageContextMenuClient.h: * UIProcess/API/C/WKPageFindClient.h: * UIProcess/API/C/WKPageFindMatchesClient.h: * UIProcess/API/C/WKPageFormClient.h: * UIProcess/API/C/WKPageLoaderClient.h: * UIProcess/API/C/WKPagePolicyClient.h: * UIProcess/API/C/WKPageUIClient.h: * UIProcess/API/Cocoa/WKBrowsingContextController.mm: (setUpPagePolicyClient): * UIProcess/API/Cocoa/WKConnection.mm: (setUpClient): * UIProcess/API/Cocoa/WKProcessGroup.mm: (setUpConnectionClient): (setUpInectedBundleClient): (setUpHistoryClient): * UIProcess/WebInspectorProxy.cpp: (WebKit::WebInspectorProxy::createInspectorPage): * UIProcess/WebUIClient.cpp: (WebKit::WebUIClient::createNewPage): (WebKit::WebUIClient::mouseDidMoveOverElement): * UIProcess/mac/WebInspectorProxyMac.mm: (WebKit::WebInspectorProxy::platformCreateInspectorPage): * WebProcess/InjectedBundle/API/c/WKBundle.cpp: (WKBundleSetClient): * WebProcess/InjectedBundle/API/c/WKBundle.h: * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp: (WKBundlePageSetContextMenuClient): (WKBundlePageSetEditorClient): (WKBundlePageSetFormClient): (WKBundlePageSetPageLoaderClient): (WKBundlePageSetResourceLoadClient): (WKBundlePageSetPolicyClient): (WKBundlePageSetUIClient): (WKBundlePageSetFullScreenClient): (WKBundlePageSetDiagnosticLoggingClient): * WebProcess/InjectedBundle/API/c/WKBundlePage.h: * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h: * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: (WKBundlePageOverlayCreate): (WKBundlePageOverlaySetAccessibilityClient): * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h: * WebProcess/InjectedBundle/API/c/WKBundlePagePolicyClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageResourceLoadClient.h: * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h: * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h: * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm: (WKBundlePageBannerCreateBannerWithCALayer): * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm: (setUpBundleClient): Tools: Update for WebKit2 API changes. * MiniBrowser/mac/AppDelegate.m: (-[BrowserAppDelegate init]): * MiniBrowser/mac/WK2BrowserWindowController.m: (-[WK2BrowserWindowController awakeFromNib]): * TestWebKitAPI/InjectedBundleController.cpp: (TestWebKitAPI::InjectedBundleController::initialize): * TestWebKitAPI/Tests/WebKit2/AboutBlankLoad.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/CanHandleRequest.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/CloseThenTerminate.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/CookieManager.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionBasic::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp: (TestWebKitAPI::DOMWindowExtensionNoCache::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/DidAssociateFormControls_Bundle.cpp: (TestWebKitAPI::DidAssociateFormControlsTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/DidNotHandleKeyDown.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/DownloadDecideDestinationCrash.cpp: (TestWebKitAPI::setContextDownloadClient): (TestWebKitAPI::setPagePolicyClient): * TestWebKitAPI/Tests/WebKit2/FailedLoad.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/Find.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FindMatches.mm: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ForceRepaint.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FrameMIMETypeHTML.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/FrameMIMETypePNG.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/Geolocation.cpp: (TestWebKitAPI::setupGeolocationProvider): (TestWebKitAPI::setupView): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle.cpp: (TestWebKitAPI::setPageLoaderClient): (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp: (TestWebKitAPI::HitTestResultNodeHandleTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/InjectedBundleBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/InjectedBundleFrameHitTest_Bundle.cpp: (TestWebKitAPI::InjectedBundleFrameHitTestTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LayoutMilestonesWithAllContentInFrame.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp: (TestWebKitAPI::LoadCanceledNoServerRedirectCallbackTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/LoadPageOnCrash.cpp: (TestWebKitAPI::WebKit2CrashLoader::WebKit2CrashLoader): * TestWebKitAPI/Tests/WebKit2/MouseMoveAfterCrash.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/PageLoadBasic.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ParentFrame.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/ParentFrame_Bundle.cpp: (TestWebKitAPI::ParentFrameTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications.mm: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/PasteboardNotifications_Bundle.cpp: (TestWebKitAPI::PasteboardNotificationsTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ReloadPageAfterCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResizeReversePaginatedWebView.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly.cpp: (TestWebKitAPI::setInjectedBundleClient): (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/ScrollPinningBehaviors.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp: (TestWebKitAPI::ShouldGoToBackForwardListItemTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/SpacebarScrolling.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/TerminateTwice.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/UserMessage.cpp: (TestWebKitAPI::WebKit2UserMessageRoundTripTest::setInjectedBundleClient): (TestWebKitAPI::WebKit2UserMessageRoundTripTest::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/WKConnection.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/WKConnection_Bundle.cpp: (TestWebKitAPI::WKConnectionTest::initialize): * TestWebKitAPI/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp: (TestWebKitAPI::setPageLoaderClient): * TestWebKitAPI/Tests/WebKit2/WebArchive.cpp: (TestWebKitAPI::setInjectedBundleClient): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/WillLoad.cpp: (TestWebKitAPI::WebKit2WillLoadTest::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/WillLoad_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent.cpp: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp: (TestWebKitAPI::WillSendSubmitEventTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2/mac/EditorCommands.mm: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2/mac/GetBackingScaleFactor.mm: (TestWebKitAPI::setInjectedBundleClient): * TestWebKitAPI/Tests/WebKit2/mac/GetPIDAfterAbortedProcessLaunch.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebKit2ObjC/CustomProtocolsInvalidScheme_Bundle.cpp: * TestWebKitAPI/Tests/WebKit2ObjC/PreventImageLoadWithAutoResizing_Bundle.cpp: (TestWebKitAPI::DenyWillSendRequestTest::didCreatePage): * TestWebKitAPI/Tests/WebKit2ObjC/WKRemoteObjectRegistry.mm: (TestWebKitAPI::didCreateConnection): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/mac/PageVisibilityStateWithWindowChanges.mm: (TestWebKitAPI::PageVisibilityStateWithWindowChanges::initializeView): * TestWebKitAPI/Tests/mac/WKRemoteObjectRegistry_Bundle.mm: * TestWebKitAPI/mac/WebKitAgnosticTest.mm: (TestWebKitAPI::setPageLoaderClient): * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::initialize): * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: (WTR::InjectedBundlePage::InjectedBundlePage): * WebKitTestRunner/TestController.cpp: (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::createWebViewWithOptions): Canonical link: https://commits.webkit.org/143331@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@160104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-12-04 18:49:49 +00:00
WKGeolocationManagerSetProvider(m_geolocationManager, &providerCallback.base);
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
}
GeolocationProviderMock::~GeolocationProviderMock()
{
WKGeolocationManagerSetProvider(m_geolocationManager, 0);
}
Clients of optional should use has_value instead of relying on hasValue macro https://bugs.webkit.org/show_bug.cgi?id=226395 Reviewed by Chris Dumez. Source/JavaScriptCore: * bytecompiler/NodesCodegen.cpp: (JSC::RegExpNode::emitBytecode): Don't use hasValue. Source/WebCore: In some files we are touching, moved from Optional to std::optional, but doing that consistently in files we are not otherwise modifying is out of scope here. In some places, use has_value instead of hasValue. In others, improved further by not using has_value explicitly when it's clearer to do so. Wasn't 100% consistent about that, but did aim to cover 100% of the hasValue call sites. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): Don't use hasValue. * Modules/webxr/WebXRFrame.cpp: (WebCore::WebXRFrame::getViewerPose): Ditto. (WebCore::WebXRFrame::getPose): Ditto. * Modules/webxr/WebXRGamepad.cpp: (WebCore::WebXRGamepad::WebXRGamepad): Ditto. * Modules/webxr/WebXRInputSource.cpp: (WebCore::WebXRInputSource::requiresInputSourceChange): Use has_value. * bindings/js/DOMPromiseProxy.h: (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const): Ditto. (WebCore::DOMPromiseProxy<IDLUndefined>::isFulfilled const): Ditto. (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const): Ditto. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): Ditto. * css/CSSFontFaceSet.cpp: (WebCore::CSSFontFaceSet::addToFacesLookupTable): Removed unneeded double check of optional value. !x and !x.has_value() check the same thing. (WebCore::CSSFontFaceSet::remove): Ditto. (WebCore::CSSFontFaceSet::fontFace): Simplified code with extra local variables to use an idiom that does not use hasValue. Since using *, ->, or value() on an optional already asserts, there is no need to explicitly assert in the caller. * css/CSSGradientValue.cpp: (WebCore::GradientStop::isSpecified const): Use has_value. * css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::fontRanges): Removed unneeded calls to hasValue. * css/FontFace.cpp: (WebCore::FontFace::family const): Use has_value. (WebCore::FontFace::style const): Ditto. (WebCore::FontFace::weight const): Ditto. (WebCore::FontFace::stretch const): Ditto. (WebCore::FontFace::unicodeRange const): Ditto. (WebCore::FontFace::featureSettings const): Ditto. (WebCore::FontFace::display const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Ditto. * display/css/DisplayStyle.h: Ditto. * dom/DataTransferItemList.h: Ditto. * dom/Document.cpp: (WebCore::Document::updateHighlightPositions): Ditto. * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): Ditto. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::hasPendingCorrection const): Ditto. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): Don't call hasValue. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::captionDisplayMode): Ditto. * html/ImageBitmap.h: Ditto. * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::setScreenSizeOverride): Use has_value. * layout/LayoutPhase.cpp: (WebCore::Layout::PhaseScope::PhaseScope): Ditto. * layout/formattingContexts/inline/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const): Ditto. * layout/formattingContexts/inline/InlineLine.h: Ditto. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::defaultWheelEventHandler): Ditto. * page/ios/ContentChangeObserver.cpp: (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope): Ditto. * page/scrolling/ScrollSnapOffsetsInfo.cpp: (WebCore::closestSnapOffsetWithInfoAndAxis): Ditto. * platform/ScrollController.cpp: (WebCore::ScrollController::adjustScrollDestination): Don't use hasValue. * platform/cocoa/SystemBattery.mm: (WebCore::systemHasBattery): Use has_value. (WebCore::systemHasAC): Use has_value. * platform/graphics/Gradient.h: Ditto. * platform/graphics/ImageSource.h: Ditto. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::wouldTaintOrigin const): Changed idiom to not use hasValue. * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (setGLContext): Do not use hasValue. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::ElementFactories::hasElementForMediaType const): Ditto. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Ditto. (WebCore::MediaPlayerPrivateGStreamer::performTaskAtMediaTime): Ditto. (WebCore::MediaPlayerPrivateGStreamer::triggerRepaint): Ditto. * platform/graphics/gstreamer/eme/CDMProxyThunder.cpp: (WebCore::CDMProxyThunder::getDecryptionSession const): Use has_value. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::hasType const): Use has_value. (WebCore::CDMInstanceSessionThunder::cdmInstanceThunder const): Use a pointer for the erturn value instead of Optional<&>. This hasn't compiled since we switched to std::optional so I suspect this code is not compiled by EWS or the buildbot. * platform/graphics/gstreamer/eme/CDMThunder.h: Updated to match above. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::parseDemuxerSrcPadCaps): Use value_or. (WebCore::AppendPipeline::appsinkCapsChanged): Do not use has_value. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): Ditto. * platform/graphics/transforms/TransformState.h: Use has_value. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (WebCore::supportsPictureInPicture): Ditto. * platform/mac/NSScrollerImpDetails.mm: (WebCore::ScrollerStyle::recommendedScrollerStyle): Ditto. * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::isSystemPreview const): Ditto. * platform/xr/openxr/OpenXRInputSource.cpp: (PlatformXR::OpenXRInputSource::getInputSource const): Ditto. * rendering/EventRegion.h: Ditto. * rendering/GridTrackSizingAlgorithm.h: Remove unnecessary assertion, since the * operator already does the assertion. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::canComputePercentageFlexBasis): Use has_value. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::setExplicitValue): Ditto. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::systemFocusRingColor): Ditto. * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded): Ditto. * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::createSVGTransformFromMatrix): Changed idiom to not call hasValue. * svg/SVGTransform.h: Ditto. * testing/WebFakeXRDevice.cpp: (WebCore::WebFakeXRDevice::setViews): Ditto. Source/WebDriver: * socket/SessionHostSocket.cpp: (WebDriver::SessionHost::isConnected const): Use has_value. Source/WebKit: * Platform/IPC/ArgumentCoders.h: Use std::optional; there was no hasValue in here and I edited it by mistake, but we want to do this eventually. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Removed using namespace WebCore. (IPC::ArgumentCoder<Ref<WebCore::Font>>::decodePlatformData): Use has_value. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getClientSDKVersion): Ditto. * Shared/WebCoreArgumentCoders.cpp: (IPC::decodeImage): Changed idiom to not call hasValue. (IPC::ArgumentCoder<Ref<Font>>::decode): Ditto. * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: (WebKit::MediaFormatReader::finishParsing): Use has_value. (WebKit::MediaFormatReader::copyProperty): Ditto. (WebKit::MediaFormatReader::copyTrackArray): Ditto. * Shared/win/WebCoreArgumentCodersWin.cpp: (IPC::ArgumentCoder<Ref<Font>>::decodePlatformData): Do not call hasValue. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration encodeWithCoder:]): Changed idiom to not use hasValue. * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::setState): Use has_value. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::AutomationCommandError::toProtocolString): Changed idiom to not use hasValue. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::determineDataOwner const): Use has_value. * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::sendWebInspectorEvent): Changed idiom to not use hasValue. * UIProcess/glib/UserMediaPermissionRequestManagerProxyGLib.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::platformValidateUserMediaRequestConstraints): Ditto. * WebProcess/GPU/media/MediaSourcePrivateRemote.cpp: (WebKit::MediaSourcePrivateRemote::addSourceBuffer): Use has_value. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::platformDidReceiveLoadParameters): Ditto. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::notifyPreferencesChanged): Changed idiom to not call hasValue. Source/WTF: * wtf/Hasher.h: Use has_value. * wtf/Optional.h: Remove hasValue macro. Not needed any more, but also a bit dangerous because of how widespread the use of hasValue is for things other than WTF::Optional. Tools: * TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp: Use has_value. * TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp: Ditto. * TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp: Ditto. * TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp: (AudioRenderingWebViewTest::handleStart): Ditto. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::setPosition): Ditto. * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: (-[TestRunnerWKWebView canPerformAction:withSender:]): Ditto. Canonical link: https://commits.webkit.org/238281@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-29 22:08:56 +00:00
void GeolocationProviderMock::setPosition(double latitude, double longitude, double accuracy, std::optional<double> altitude, std::optional<double> altitudeAccuracy, std::optional<double> heading, std::optional<double> speed, std::optional<double> floorLevel)
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
{
Clients of optional should use has_value instead of relying on hasValue macro https://bugs.webkit.org/show_bug.cgi?id=226395 Reviewed by Chris Dumez. Source/JavaScriptCore: * bytecompiler/NodesCodegen.cpp: (JSC::RegExpNode::emitBytecode): Don't use hasValue. Source/WebCore: In some files we are touching, moved from Optional to std::optional, but doing that consistently in files we are not otherwise modifying is out of scope here. In some places, use has_value instead of hasValue. In others, improved further by not using has_value explicitly when it's clearer to do so. Wasn't 100% consistent about that, but did aim to cover 100% of the hasValue call sites. * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::create): Don't use hasValue. * Modules/webxr/WebXRFrame.cpp: (WebCore::WebXRFrame::getViewerPose): Ditto. (WebCore::WebXRFrame::getPose): Ditto. * Modules/webxr/WebXRGamepad.cpp: (WebCore::WebXRGamepad::WebXRGamepad): Ditto. * Modules/webxr/WebXRInputSource.cpp: (WebCore::WebXRInputSource::requiresInputSourceChange): Use has_value. * bindings/js/DOMPromiseProxy.h: (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const): Ditto. (WebCore::DOMPromiseProxy<IDLUndefined>::isFulfilled const): Ditto. (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const): Ditto. * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): Ditto. * css/CSSFontFaceSet.cpp: (WebCore::CSSFontFaceSet::addToFacesLookupTable): Removed unneeded double check of optional value. !x and !x.has_value() check the same thing. (WebCore::CSSFontFaceSet::remove): Ditto. (WebCore::CSSFontFaceSet::fontFace): Simplified code with extra local variables to use an idiom that does not use hasValue. Since using *, ->, or value() on an optional already asserts, there is no need to explicitly assert in the caller. * css/CSSGradientValue.cpp: (WebCore::GradientStop::isSpecified const): Use has_value. * css/CSSSegmentedFontFace.cpp: (WebCore::CSSSegmentedFontFace::fontRanges): Removed unneeded calls to hasValue. * css/FontFace.cpp: (WebCore::FontFace::family const): Use has_value. (WebCore::FontFace::style const): Ditto. (WebCore::FontFace::weight const): Ditto. (WebCore::FontFace::stretch const): Ditto. (WebCore::FontFace::unicodeRange const): Ditto. (WebCore::FontFace::featureSettings const): Ditto. (WebCore::FontFace::display const): Ditto. * css/parser/CSSSelectorParser.cpp: (WebCore::consumeANPlusB): Ditto. * display/css/DisplayStyle.h: Ditto. * dom/DataTransferItemList.h: Ditto. * dom/Document.cpp: (WebCore::Document::updateHighlightPositions): Ditto. * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): Ditto. * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::hasPendingCorrection const): Ditto. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): Don't call hasValue. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::captionDisplayMode): Ditto. * html/ImageBitmap.h: Ditto. * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::setScreenSizeOverride): Use has_value. * layout/LayoutPhase.cpp: (WebCore::Layout::PhaseScope::PhaseScope): Ditto. * layout/formattingContexts/inline/InlineContentBreaker.cpp: (WebCore::Layout::InlineContentBreaker::tryBreakingTextRun const): Ditto. * layout/formattingContexts/inline/InlineLine.h: Ditto. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::parseAccessControlMaxAge): Ditto. * page/EventHandler.cpp: (WebCore::EventHandler::defaultWheelEventHandler): Ditto. * page/ios/ContentChangeObserver.cpp: (WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope): Ditto. * page/scrolling/ScrollSnapOffsetsInfo.cpp: (WebCore::closestSnapOffsetWithInfoAndAxis): Ditto. * platform/ScrollController.cpp: (WebCore::ScrollController::adjustScrollDestination): Don't use hasValue. * platform/cocoa/SystemBattery.mm: (WebCore::systemHasBattery): Use has_value. (WebCore::systemHasAC): Use has_value. * platform/graphics/Gradient.h: Ditto. * platform/graphics/ImageSource.h: Ditto. * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::wouldTaintOrigin const): Changed idiom to not use hasValue. * platform/graphics/gstreamer/GLVideoSinkGStreamer.cpp: (setGLContext): Do not use hasValue. * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: (WebCore::GStreamerRegistryScanner::ElementFactories::hasElementForMediaType const): Ditto. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Ditto. (WebCore::MediaPlayerPrivateGStreamer::performTaskAtMediaTime): Ditto. (WebCore::MediaPlayerPrivateGStreamer::triggerRepaint): Ditto. * platform/graphics/gstreamer/eme/CDMProxyThunder.cpp: (WebCore::CDMProxyThunder::getDecryptionSession const): Use has_value. * platform/graphics/gstreamer/eme/CDMThunder.cpp: (WebCore::ParsedResponseMessage::hasType const): Use has_value. (WebCore::CDMInstanceSessionThunder::cdmInstanceThunder const): Use a pointer for the erturn value instead of Optional<&>. This hasn't compiled since we switched to std::optional so I suspect this code is not compiled by EWS or the buildbot. * platform/graphics/gstreamer/eme/CDMThunder.h: Updated to match above. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::parseDemuxerSrcPadCaps): Use value_or. (WebCore::AppendPipeline::appsinkCapsChanged): Do not use has_value. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): Ditto. * platform/graphics/transforms/TransformState.h: Use has_value. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (WebCore::supportsPictureInPicture): Ditto. * platform/mac/NSScrollerImpDetails.mm: (WebCore::ScrollerStyle::recommendedScrollerStyle): Ditto. * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::isSystemPreview const): Ditto. * platform/xr/openxr/OpenXRInputSource.cpp: (PlatformXR::OpenXRInputSource::getInputSource const): Ditto. * rendering/EventRegion.h: Ditto. * rendering/GridTrackSizingAlgorithm.h: Remove unnecessary assertion, since the * operator already does the assertion. * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::canComputePercentageFlexBasis): Use has_value. * rendering/RenderListItem.cpp: (WebCore::RenderListItem::setExplicitValue): Ditto. * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::systemFocusRingColor): Ditto. * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::removeAnonymousWrappersForInlineChildrenIfNeeded): Ditto. * svg/SVGSVGElement.cpp: (WebCore::SVGSVGElement::createSVGTransformFromMatrix): Changed idiom to not call hasValue. * svg/SVGTransform.h: Ditto. * testing/WebFakeXRDevice.cpp: (WebCore::WebFakeXRDevice::setViews): Ditto. Source/WebDriver: * socket/SessionHostSocket.cpp: (WebDriver::SessionHost::isConnected const): Use has_value. Source/WebKit: * Platform/IPC/ArgumentCoders.h: Use std::optional; there was no hasValue in here and I edited it by mistake, but we want to do this eventually. * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Removed using namespace WebCore. (IPC::ArgumentCoder<Ref<WebCore::Font>>::decodePlatformData): Use has_value. * Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceEntryPoint.mm: (WebKit::XPCServiceInitializerDelegate::getClientSDKVersion): Ditto. * Shared/WebCoreArgumentCoders.cpp: (IPC::decodeImage): Changed idiom to not call hasValue. (IPC::ArgumentCoder<Ref<Font>>::decode): Ditto. * Shared/mac/MediaFormatReader/MediaFormatReader.cpp: (WebKit::MediaFormatReader::finishParsing): Use has_value. (WebKit::MediaFormatReader::copyProperty): Ditto. (WebKit::MediaFormatReader::copyTrackArray): Ditto. * Shared/win/WebCoreArgumentCodersWin.cpp: (IPC::ArgumentCoder<Ref<Font>>::decodePlatformData): Do not call hasValue. * UIProcess/API/Cocoa/WKWebViewConfiguration.mm: (-[WKWebViewConfiguration encodeWithCoder:]): Changed idiom to not use hasValue. * UIProcess/API/glib/InputMethodFilter.cpp: (WebKit::InputMethodFilter::setState): Use has_value. * UIProcess/Automation/WebAutomationSession.cpp: (WebKit::AutomationCommandError::toProtocolString): Changed idiom to not use hasValue. * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm: (WebKit::WebPasteboardProxy::determineDataOwner const): Use has_value. * UIProcess/Inspector/socket/RemoteInspectorClient.cpp: (WebKit::RemoteInspectorClient::sendWebInspectorEvent): Changed idiom to not use hasValue. * UIProcess/glib/UserMediaPermissionRequestManagerProxyGLib.cpp: (WebKit::UserMediaPermissionRequestManagerProxy::platformValidateUserMediaRequestConstraints): Ditto. * WebProcess/GPU/media/MediaSourcePrivateRemote.cpp: (WebKit::MediaSourcePrivateRemote::addSourceBuffer): Use has_value. * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: (WebKit::WebPage::platformDidReceiveLoadParameters): Ditto. * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::notifyPreferencesChanged): Changed idiom to not call hasValue. Source/WTF: * wtf/Hasher.h: Use has_value. * wtf/Optional.h: Remove hasValue macro. Not needed any more, but also a bit dangerous because of how widespread the use of hasValue is for things other than WTF::Optional. Tools: * TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp: Use has_value. * TestWebKitAPI/Tests/WebCore/CBORWriterTest.cpp: Ditto. * TestWebKitAPI/Tests/WebKitGLib/TestWebKitPolicyClient.cpp: Ditto. * TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebView.cpp: (AudioRenderingWebViewTest::handleStart): Ditto. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::setPosition): Ditto. * WebKitTestRunner/cocoa/TestRunnerWKWebView.mm: (-[TestRunnerWKWebView canPerformAction:withSender:]): Ditto. Canonical link: https://commits.webkit.org/238281@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@278244 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-29 22:08:56 +00:00
m_position.adopt(WKGeolocationPositionCreate_c(WallTime::now().secondsSinceEpoch().seconds(), latitude, longitude, accuracy, altitude.has_value(), altitude.value_or(0), altitudeAccuracy.has_value(), altitudeAccuracy.value_or(0), heading.has_value(), heading.value_or(0), speed.has_value(), speed.value_or(0), floorLevel.has_value(), floorLevel.value_or(0)));
Fix Geolocation/window-close-crash.html and harden WebKitTestRunner for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97608 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-10-03 Reviewed by Sam Weinig. Tools: The test fast/dom/Geolocation/window-close-crash.html was crashing because handleGeolocationPermissionRequest() was executed on the wrong pointer. Depending on how the page was created, the void* clientInfo can either be a PlatformWebView or a TestController. Using the global TestController fixes the issue. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): To be reliable, the test fast/dom/Geolocation/maximum-age.html needs the setting the position to clear the error and vice versa. This is the same behavior as GeolocationClientMock and MockGeolocationProvider of WebKit1. (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): Some tests expect the position/error cant be sent multiple time, just keep the position after sending. * WebKitTestRunner/TestController.cpp: (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: Let's play as if we did not know what is in GeolocationPermissionRequestManagerProxy like a real client would have to do. LayoutTests: * platform/wk2/TestExpectations: Unskip fast/dom/Geolocation/window-close-crash.html. * platform/mac-wk2/TestExpectations: Unskip fast/dom/Geolocation/maximum-age.html. Canonical link: https://commits.webkit.org/116322@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-03 21:45:50 +00:00
m_hasError = false;
m_errorMessage.clear();
Add missing support for Geolocation tests on WebKit2 https://bugs.webkit.org/show_bug.cgi?id=97518 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-25 Reviewed by Sam Weinig. Source/WebKit2: The existing API for reporting error does not support passing and error message. The interface UIProcess<->WebProcess is changed to take an error message, the existing API now pass a null String, and the new function WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage() provide the extended support with error message. * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition): * UIProcess/WebGeolocationManagerProxy.h: (WebGeolocationManagerProxy): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didFailToDeterminePosition): * WebProcess/Geolocation/WebGeolocationManager.h: (WebGeolocationManager): * WebProcess/Geolocation/WebGeolocationManager.messages.in: Tools: There are two main features added to the tooling to make the test run: -Add support for error reporting for position errors through setMockGeolocationPositionUnavailableError. -Support the 3 states permission: undefined-allowed-denied. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): * WebKitTestRunner/GeolocationProviderMock.h: (GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::resetStateToConsistentValues): (WTR::TestController::setGeolocationPermission): (WTR::TestController::setMockGeolocationPosition): (WTR::TestController::setMockGeolocationPositionUnavailableError): (WTR::TestController::handleGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: (TestController): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): LayoutTests: Unskip almost all the layout tests. * platform/wk2/Skipped: Canonical link: https://commits.webkit.org/115554@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-25 19:06:41 +00:00
sendPositionIfNeeded();
}
void GeolocationProviderMock::setPositionUnavailableError(WKStringRef errorMessage)
{
m_errorMessage = errorMessage;
m_hasError = true;
Fix Geolocation/window-close-crash.html and harden WebKitTestRunner for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97608 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-10-03 Reviewed by Sam Weinig. Tools: The test fast/dom/Geolocation/window-close-crash.html was crashing because handleGeolocationPermissionRequest() was executed on the wrong pointer. Depending on how the page was created, the void* clientInfo can either be a PlatformWebView or a TestController. Using the global TestController fixes the issue. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): To be reliable, the test fast/dom/Geolocation/maximum-age.html needs the setting the position to clear the error and vice versa. This is the same behavior as GeolocationClientMock and MockGeolocationProvider of WebKit1. (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): Some tests expect the position/error cant be sent multiple time, just keep the position after sending. * WebKitTestRunner/TestController.cpp: (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: Let's play as if we did not know what is in GeolocationPermissionRequestManagerProxy like a real client would have to do. LayoutTests: * platform/wk2/TestExpectations: Unskip fast/dom/Geolocation/window-close-crash.html. * platform/mac-wk2/TestExpectations: Unskip fast/dom/Geolocation/maximum-age.html. Canonical link: https://commits.webkit.org/116322@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-03 21:45:50 +00:00
m_position.clear();
Add missing support for Geolocation tests on WebKit2 https://bugs.webkit.org/show_bug.cgi?id=97518 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-25 Reviewed by Sam Weinig. Source/WebKit2: The existing API for reporting error does not support passing and error message. The interface UIProcess<->WebProcess is changed to take an error message, the existing API now pass a null String, and the new function WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage() provide the extended support with error message. * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition): * UIProcess/WebGeolocationManagerProxy.h: (WebGeolocationManagerProxy): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didFailToDeterminePosition): * WebProcess/Geolocation/WebGeolocationManager.h: (WebGeolocationManager): * WebProcess/Geolocation/WebGeolocationManager.messages.in: Tools: There are two main features added to the tooling to make the test run: -Add support for error reporting for position errors through setMockGeolocationPositionUnavailableError. -Support the 3 states permission: undefined-allowed-denied. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): * WebKitTestRunner/GeolocationProviderMock.h: (GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::resetStateToConsistentValues): (WTR::TestController::setGeolocationPermission): (WTR::TestController::setMockGeolocationPosition): (WTR::TestController::setMockGeolocationPositionUnavailableError): (WTR::TestController::handleGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: (TestController): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): LayoutTests: Unskip almost all the layout tests. * platform/wk2/Skipped: Canonical link: https://commits.webkit.org/115554@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-25 19:06:41 +00:00
sendErrorIfNeeded();
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
}
void GeolocationProviderMock::startUpdating(WKGeolocationManagerRef geolocationManager)
{
ASSERT_UNUSED(geolocationManager, geolocationManager == m_geolocationManager);
m_isActive = true;
Add missing support for Geolocation tests on WebKit2 https://bugs.webkit.org/show_bug.cgi?id=97518 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-25 Reviewed by Sam Weinig. Source/WebKit2: The existing API for reporting error does not support passing and error message. The interface UIProcess<->WebProcess is changed to take an error message, the existing API now pass a null String, and the new function WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage() provide the extended support with error message. * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition): * UIProcess/WebGeolocationManagerProxy.h: (WebGeolocationManagerProxy): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didFailToDeterminePosition): * WebProcess/Geolocation/WebGeolocationManager.h: (WebGeolocationManager): * WebProcess/Geolocation/WebGeolocationManager.messages.in: Tools: There are two main features added to the tooling to make the test run: -Add support for error reporting for position errors through setMockGeolocationPositionUnavailableError. -Support the 3 states permission: undefined-allowed-denied. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): * WebKitTestRunner/GeolocationProviderMock.h: (GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::resetStateToConsistentValues): (WTR::TestController::setGeolocationPermission): (WTR::TestController::setMockGeolocationPosition): (WTR::TestController::setMockGeolocationPositionUnavailableError): (WTR::TestController::handleGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: (TestController): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): LayoutTests: Unskip almost all the layout tests. * platform/wk2/Skipped: Canonical link: https://commits.webkit.org/115554@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-25 19:06:41 +00:00
sendPositionIfNeeded();
sendErrorIfNeeded();
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
}
void GeolocationProviderMock::stopUpdating(WKGeolocationManagerRef geolocationManager)
{
ASSERT_UNUSED(geolocationManager, geolocationManager == m_geolocationManager);
m_isActive = false;
}
Add missing support for Geolocation tests on WebKit2 https://bugs.webkit.org/show_bug.cgi?id=97518 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-25 Reviewed by Sam Weinig. Source/WebKit2: The existing API for reporting error does not support passing and error message. The interface UIProcess<->WebProcess is changed to take an error message, the existing API now pass a null String, and the new function WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage() provide the extended support with error message. * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition): * UIProcess/WebGeolocationManagerProxy.h: (WebGeolocationManagerProxy): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didFailToDeterminePosition): * WebProcess/Geolocation/WebGeolocationManager.h: (WebGeolocationManager): * WebProcess/Geolocation/WebGeolocationManager.messages.in: Tools: There are two main features added to the tooling to make the test run: -Add support for error reporting for position errors through setMockGeolocationPositionUnavailableError. -Support the 3 states permission: undefined-allowed-denied. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): * WebKitTestRunner/GeolocationProviderMock.h: (GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::resetStateToConsistentValues): (WTR::TestController::setGeolocationPermission): (WTR::TestController::setMockGeolocationPosition): (WTR::TestController::setMockGeolocationPositionUnavailableError): (WTR::TestController::handleGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: (TestController): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): LayoutTests: Unskip almost all the layout tests. * platform/wk2/Skipped: Canonical link: https://commits.webkit.org/115554@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-25 19:06:41 +00:00
void GeolocationProviderMock::sendPositionIfNeeded()
{
Fix Geolocation/window-close-crash.html and harden WebKitTestRunner for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97608 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-10-03 Reviewed by Sam Weinig. Tools: The test fast/dom/Geolocation/window-close-crash.html was crashing because handleGeolocationPermissionRequest() was executed on the wrong pointer. Depending on how the page was created, the void* clientInfo can either be a PlatformWebView or a TestController. Using the global TestController fixes the issue. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): To be reliable, the test fast/dom/Geolocation/maximum-age.html needs the setting the position to clear the error and vice versa. This is the same behavior as GeolocationClientMock and MockGeolocationProvider of WebKit1. (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): Some tests expect the position/error cant be sent multiple time, just keep the position after sending. * WebKitTestRunner/TestController.cpp: (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: Let's play as if we did not know what is in GeolocationPermissionRequestManagerProxy like a real client would have to do. LayoutTests: * platform/wk2/TestExpectations: Unskip fast/dom/Geolocation/window-close-crash.html. * platform/mac-wk2/TestExpectations: Unskip fast/dom/Geolocation/maximum-age.html. Canonical link: https://commits.webkit.org/116322@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-03 21:45:50 +00:00
if (m_isActive && m_position)
Add missing support for Geolocation tests on WebKit2 https://bugs.webkit.org/show_bug.cgi?id=97518 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-25 Reviewed by Sam Weinig. Source/WebKit2: The existing API for reporting error does not support passing and error message. The interface UIProcess<->WebProcess is changed to take an error message, the existing API now pass a null String, and the new function WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage() provide the extended support with error message. * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition): * UIProcess/WebGeolocationManagerProxy.h: (WebGeolocationManagerProxy): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didFailToDeterminePosition): * WebProcess/Geolocation/WebGeolocationManager.h: (WebGeolocationManager): * WebProcess/Geolocation/WebGeolocationManager.messages.in: Tools: There are two main features added to the tooling to make the test run: -Add support for error reporting for position errors through setMockGeolocationPositionUnavailableError. -Support the 3 states permission: undefined-allowed-denied. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): * WebKitTestRunner/GeolocationProviderMock.h: (GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::resetStateToConsistentValues): (WTR::TestController::setGeolocationPermission): (WTR::TestController::setMockGeolocationPosition): (WTR::TestController::setMockGeolocationPositionUnavailableError): (WTR::TestController::handleGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: (TestController): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): LayoutTests: Unskip almost all the layout tests. * platform/wk2/Skipped: Canonical link: https://commits.webkit.org/115554@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-25 19:06:41 +00:00
WKGeolocationManagerProviderDidChangePosition(m_geolocationManager, m_position.get());
}
void GeolocationProviderMock::sendErrorIfNeeded()
{
Fix Geolocation/window-close-crash.html and harden WebKitTestRunner for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97608 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-10-03 Reviewed by Sam Weinig. Tools: The test fast/dom/Geolocation/window-close-crash.html was crashing because handleGeolocationPermissionRequest() was executed on the wrong pointer. Depending on how the page was created, the void* clientInfo can either be a PlatformWebView or a TestController. Using the global TestController fixes the issue. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): To be reliable, the test fast/dom/Geolocation/maximum-age.html needs the setting the position to clear the error and vice versa. This is the same behavior as GeolocationClientMock and MockGeolocationProvider of WebKit1. (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): Some tests expect the position/error cant be sent multiple time, just keep the position after sending. * WebKitTestRunner/TestController.cpp: (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: Let's play as if we did not know what is in GeolocationPermissionRequestManagerProxy like a real client would have to do. LayoutTests: * platform/wk2/TestExpectations: Unskip fast/dom/Geolocation/window-close-crash.html. * platform/mac-wk2/TestExpectations: Unskip fast/dom/Geolocation/maximum-age.html. Canonical link: https://commits.webkit.org/116322@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-03 21:45:50 +00:00
if (m_isActive && m_hasError)
Add missing support for Geolocation tests on WebKit2 https://bugs.webkit.org/show_bug.cgi?id=97518 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-25 Reviewed by Sam Weinig. Source/WebKit2: The existing API for reporting error does not support passing and error message. The interface UIProcess<->WebProcess is changed to take an error message, the existing API now pass a null String, and the new function WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage() provide the extended support with error message. * UIProcess/API/C/WKGeolocationManager.cpp: (WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage): * UIProcess/API/C/WKGeolocationManager.h: * UIProcess/WebGeolocationManagerProxy.cpp: (WebKit::WebGeolocationManagerProxy::providerDidFailToDeterminePosition): * UIProcess/WebGeolocationManagerProxy.h: (WebGeolocationManagerProxy): * WebProcess/Geolocation/WebGeolocationManager.cpp: (WebKit::WebGeolocationManager::didFailToDeterminePosition): * WebProcess/Geolocation/WebGeolocationManager.h: (WebGeolocationManager): * WebProcess/Geolocation/WebGeolocationManager.messages.in: Tools: There are two main features added to the tooling to make the test run: -Add support for error reporting for position errors through setMockGeolocationPositionUnavailableError. -Support the 3 states permission: undefined-allowed-denied. * WebKitTestRunner/GeolocationProviderMock.cpp: (WTR::GeolocationProviderMock::GeolocationProviderMock): (WTR::GeolocationProviderMock::setPosition): (WTR::GeolocationProviderMock::setPositionUnavailableError): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::sendPositionIfNeeded): (WTR::GeolocationProviderMock::sendErrorIfNeeded): * WebKitTestRunner/GeolocationProviderMock.h: (GeolocationProviderMock): * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setMockGeolocationPositionUnavailableError): * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::resetStateToConsistentValues): (WTR::TestController::setGeolocationPermission): (WTR::TestController::setMockGeolocationPosition): (WTR::TestController::setMockGeolocationPositionUnavailableError): (WTR::TestController::handleGeolocationPermissionRequest): (WTR::TestController::decidePolicyForGeolocationPermissionRequestIfPossible): * WebKitTestRunner/TestController.h: (TestController): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): LayoutTests: Unskip almost all the layout tests. * platform/wk2/Skipped: Canonical link: https://commits.webkit.org/115554@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-25 19:06:41 +00:00
WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage(m_geolocationManager, m_errorMessage.get());
}
[WK2] Add basic testing support for Geolocation https://bugs.webkit.org/show_bug.cgi?id=97278 Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-09-21 Reviewed by Kenneth Rohde Christiansen. Source/WebKit2: * Shared/API/c/WKNumber.h: Fix an unfortunate copy-paste :) * WebProcess/InjectedBundle/API/c/WKBundle.cpp: * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h: * WebProcess/InjectedBundle/InjectedBundle.cpp: * WebProcess/InjectedBundle/InjectedBundle.h: (InjectedBundle): Remove the code forcing the Geolocation permissions. It was working around the normal Geolocation code and updating all the GeolocationController, which is a terrible idea. Tools: Update the Geolocation testing to use the proper API in the UIProcess. * WebKitTestRunner/CMakeLists.txt: * WebKitTestRunner/GNUmakefile.am: * WebKitTestRunner/GeolocationProviderMock.cpp: Added. (WTR::startUpdatingCallback): (WTR::stopUpdatingCallback): (WTR::GeolocationProviderMock::GeolocationProvierMock): (WTR::GeolocationProviderMock::setMockGeolocationPosition): (WTR::GeolocationProviderMock::startUpdating): (WTR::GeolocationProviderMock::stopUpdating): (GeolocationProviderMock): The GeolocationProvider store the location update and deliver them as needed. WebCore GeolocationController do not support asynchronous update on start/stop. This is not a problem in this case because all the messages between the WebProcess and the UIProcess are asynchronous. Because of this, unlike GeolocationClientMock, we do not use a timer for event delivery. * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp: (WTR::InjectedBundle::setGeolocationPermission): (WTR::InjectedBundle::setMockGeolocationPosition): * WebKitTestRunner/InjectedBundle/InjectedBundle.h: (InjectedBundle): * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setGeolocationPermission): (WTR::TestRunner::setMockGeolocationPosition): From the InjectedBundle, we now pass the information to the UIProcess so that GeolocationProvider and the TestController can respond appropriately. * WebKitTestRunner/InjectedBundle/TestRunner.h: (TestRunner): * WebKitTestRunner/Target.pri: * WebKitTestRunner/TestController.cpp: (WTR::TestController::TestController): (WTR::decidePolicyForGeolocationPermissionRequest): (WTR::TestController::createOtherPage): (WTR::TestController::initialize): (WTR::TestController::setMockGeolocationPosition): * WebKitTestRunner/TestController.h: (TestController): (WTR::TestController::setGeolocationPermission): (WTR::TestController::isGeolocationPermissionAllowed): * WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveMessageFromInjectedBundle): * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * WebKitTestRunner/win/WebKitTestRunner.vcproj: LayoutTests: * platform/wk2/Skipped: Unskip the passing tests. Canonical link: https://commits.webkit.org/115297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-09-21 21:06:05 +00:00
} // namespace WTR