Skip to content
  • benjamin@webkit.org's avatar
    [WK2] Add basic testing support for Geolocation · 04e047f0
    benjamin@webkit.org authored
    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.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    04e047f0