WebKitTestRunner needs layoutTestController.setGeolocationPermission
<rdar://problem/8204915>
*** Bug 59202 has been marked as a duplicate of this bug. ***
Created attachment 123262 [details] Implementation of setGeolocationPermission WebKit must be builded with the Tools/Scripts/build-webkit DEFINES+=ENABLE_CLIENT_BASED_GEOLOCATION=1 command, if we want to test this special function. I have move tests to the appropriate group, most of tests which were at label "# WebKitTestRunner needs layoutTestController.setGeolocationPermission" now need layoutTestController.setMockGeolocationPosition or layoutTestController.setMockGeolocationError. Two of these tests sometimes cause WebProcess crash, they have been labeled too.
Attachment 123262 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1 LayoutTests/ChangeLog:1: ChangeLog entry has no bug number [changelog/bugnumber] [5] Total errors found: 1 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 123268 [details] Implementation of setGeolocationPermission Fixing the style issue.
Created attachment 123286 [details] Implementation of setGeolocationPermission From win buildlog: 11>..\WebProcess\InjectedBundle\InjectedBundle.cpp(52) : fatal error C1083: Cannot open include file: 'WebCore/page/GeolocationClient.h': No such file or directory That is why I have replace the imports, e.g. #include <WebCore/page/GeolocationController.h> with #include "GeolocationClient.h".
Attachment 123286 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1 Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp:33: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 1 in 11 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 123289 [details] Implementation of setGeolocationPermission Style fixing again, imports were in wrong order.
(In reply to comment #8) > Created an attachment (id=123289) [details] > Implementation of setGeolocationPermission > > Style fixing again, imports were in wrong order. Try using #include <WebCore/...> for the headers, this should fix the windows build.
Created attachment 123727 [details] Implementation of setGeolocationPermission Andras Becsi, thank you for the tip, I have done that.
Created attachment 123731 [details] Implementation of setGeolocationPermission I have inserted a new line in /WebCore/WebCore.vcproj/copyForwardingHeaders.cmd: xcopy /y /d "%ProjectDir%..\platform\mock\*.h" "%CONFIGURATIONBUILDDIR%\include\WebCore" I hope GeolocationClientMock.h can be found with this.
Comment on attachment 123731 [details] Implementation of setGeolocationPermission View in context: https://bugs.webkit.org/attachment.cgi?id=123731&action=review > Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:73 > +WK_EXPORT void WKBundlesetGeolocationPermission(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled); WKBundlesetGeolocationPermission -> WKBundle_S_etGeolocationPermission > Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp:171 > + (static_cast<GeolocationClientMock*>((*iter)->geolocationController()->client()))->setPermission(enabled); I think you can remove the parentheses around the static_cast, i.e. write static_cast<Foo*>(bar)->blub(); instead of (static_cast<Foo*>(bar))->blub();
Created attachment 124074 [details] Implementation of setGeolocationPermission Simon, thank you, I have fixed the style issues that you have mentioned.
Comment on attachment 124074 [details] Implementation of setGeolocationPermission r=me
Comment on attachment 124074 [details] Implementation of setGeolocationPermission Clearing flags on attachment: 124074 Committed r105988: <http://trac.webkit.org/changeset/105988>
All reviewed patches have been landed. Closing bug.
For info, this is not how you are supposed to test Geolocation. You are supposed to go implement the provider in the UIProcess, not punch through the layers.