[WK2] Add basic testing support for Geolocation
authorbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Sep 2012 21:06:05 +0000 (21:06 +0000)
committerbenjamin@webkit.org <benjamin@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Sep 2012 21:06:05 +0000 (21:06 +0000)
commitb21074ba341ff9fdee8ca72d077a1bd26ab4b163
tree397af5b374a4ecf25e79c074823802e3839e6da0
parenta0eddb0534b0e11f44872a79ae4b554eb3113ee5
[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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@129252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
24 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/wk2/Skipped
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/WKNumber.h
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
Tools/ChangeLog
Tools/WebKitTestRunner/CMakeLists.txt
Tools/WebKitTestRunner/GNUmakefile.am
Tools/WebKitTestRunner/GeolocationProviderMock.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/GeolocationProviderMock.h [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
Tools/WebKitTestRunner/Target.pri
Tools/WebKitTestRunner/TestController.cpp
Tools/WebKitTestRunner/TestController.h
Tools/WebKitTestRunner/TestInvocation.cpp
Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
Tools/WebKitTestRunner/win/WebKitTestRunner.vcproj