No subject
Wed Aug 1 07:28:53 PDT 2012
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:=20
* platform/wk2/Skipped: Unskip the passing tests.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a=
></li>
<li><a href=3D"#trunkLayoutTestsplatformwk2Skipped">trunk/LayoutTests/pla=
tform/wk2/Skipped</a></li>
<li><a href=3D"#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebKit2SharedAPIcWKNumberh">trunk/Source/WebKi=
t2/Shared/API/c/WKNumber.h</a></li>
<li><a href=3D"#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlecpp=
">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp</a></=
li>
<li><a href=3D"#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePri=
vateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePriva=
te.h</a></li>
<li><a href=3D"#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlec=
pp">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp</a>=
</li>
<li><a href=3D"#trunkSourceWebKit2WebProcessInjectedBundleInjectedBundleh=
">trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h</a></li=
>
<li><a href=3D"#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerCMakeListstxt">trunk/Tools/WebK=
itTestRunner/CMakeLists.txt</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerGNUmakefileam">trunk/Tools/WebK=
itTestRunner/GNUmakefile.am</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunne=
ridl">trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl=
</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp=
">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh">=
trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp">tr=
unk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh">trun=
k/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerTargetpri">trunk/Tools/WebKitTe=
stRunner/Target.pri</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerTestControllercpp">trunk/Tools/=
WebKitTestRunner/TestController.cpp</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerTestControllerh">trunk/Tools/We=
bKitTestRunner/TestController.h</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerTestInvocationcpp">trunk/Tools/=
WebKitTestRunner/TestInvocation.cpp</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerWebKitTestRunnerxcodeprojprojec=
tpbxproj">trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project=
.pbxproj</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerwinWebKitTestRunnervcproj">trun=
k/Tools/WebKitTestRunner/win/WebKitTestRunner.vcproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href=3D"#trunkToolsWebKitTestRunnerGeolocationProviderMockcpp">tru=
nk/Tools/WebKitTestRunner/GeolocationProviderMock.cpp</a></li>
<li><a href=3D"#trunkToolsWebKitTestRunnerGeolocationProviderMockh">trunk=
/Tools/WebKitTestRunner/GeolocationProviderMock.h</a></li>
</ul>
</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkLayoutTestsChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (129251 =
=3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/ChangeLog 2012-09-21 21:02:37 =
UTC (rev 129251)
+++ trunk/LayoutTests/ChangeLog 2012-09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -1,3 +1,12 @@
</span><ins>+2012-09-21 Benjamin Poulain <bpoulain at apple.com>
+
+ [WK2] Add basic testing support for Geolocation
+ https://bugs.webkit.org/show_bug.cgi?id=3D97278
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * platform/wk2/Skipped: Unskip the passing tests.
+
</ins><span class=3D"cx"> 2012-09-21 Joanmarie Diggs <jdiggs at igalia.=
com>
</span><span class=3D"cx">=20
</span><span class=3D"cx"> REGRESSION (r127882): accessibility/sp=
inbutton-value.html failing on GTK
</span></span></pre></div>
<a id=3D"trunkLayoutTestsplatformwk2Skipped"></a>
<div class=3D"modfile"><h4>Modified: trunk/LayoutTests/platform/wk2/Skipp=
ed (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/LayoutTests/platform/wk2/Skipped 2012-09-2=
1 21:02:37 UTC (rev 129251)
+++ trunk/LayoutTests/platform/wk2/Skipped 2012-09-21 21:06:05 UTC (rev 1=
29252)
</span><span class=3D"lines">@@ -288,40 +288,16 @@
</span><span class=3D"cx"> platform/mac/editing/deleting/deletionUI-minim=
um-size.html
</span><span class=3D"cx"> platform/mac/editing/deleting/deletionUI-succe=
ssful-deletion.html
</span><span class=3D"cx">=20
</span><del>-# WebKitTestRunner needs layoutTestController.setMockGeoloca=
tionPosition
-# and layoutTestController.setMockGeolocationError
-# <https://bugs.webkit.org/show_bug.cgi?id=3D59201>
-fast/dom/Geolocation/callback-exception.html
-fast/dom/Geolocation/callback-to-deleted-context.html
-fast/dom/Geolocation/callback-to-remote-context.html
-fast/dom/Geolocation/callback-to-remote-context2.html
-fast/dom/Geolocation/clear-watch-invalid-id-crash.html
</del><ins>+# Geolocation Tests for which WebKitTestRunner still misses s=
upport.
</ins><span class=3D"cx"> fast/dom/Geolocation/delayed-permission-allowed=
-for-multiple-requests.html
</span><span class=3D"cx"> fast/dom/Geolocation/delayed-permission-allowe=
d.html
</span><span class=3D"cx"> fast/dom/Geolocation/delayed-permission-denied=
-for-multiple-requests.html
</span><span class=3D"cx"> fast/dom/Geolocation/delayed-permission-denied=
.html
</span><del>-fast/dom/Geolocation/disconnected-frame-already.html
-fast/dom/Geolocation/disconnected-frame-permission-denied.html
-fast/dom/Geolocation/disconnected-frame.html
</del><span class=3D"cx"> fast/dom/Geolocation/error-clear-watch.html
</span><span class=3D"cx"> fast/dom/Geolocation/error.html
</span><span class=3D"cx"> fast/dom/Geolocation/maximum-age.html
</span><del>-fast/dom/Geolocation/multiple-requests.html
-fast/dom/Geolocation/permission-denied-already-clear-watch.html
</del><span class=3D"cx"> fast/dom/Geolocation/permission-denied-already-=
error.html
</span><del>-fast/dom/Geolocation/permission-denied-already-success.html
-fast/dom/Geolocation/permission-denied-stops-watches.html
-fast/dom/Geolocation/permission-denied.html
-fast/dom/Geolocation/position-string.html
</del><span class=3D"cx"> fast/dom/Geolocation/reentrant-error.html
</span><del>-fast/dom/Geolocation/reentrant-permission-denied.html
-fast/dom/Geolocation/reentrant-success.html
-fast/dom/Geolocation/success-clear-watch.html
-fast/dom/Geolocation/success.html
-fast/dom/Geolocation/timeout.html
-fast/dom/Geolocation/timeout-clear-watch.html
-fast/dom/Geolocation/timeout-zero.html
-fast/dom/Geolocation/timestamp.html
</del><span class=3D"cx"> fast/dom/Geolocation/watch.html
</span><span class=3D"cx"> fast/dom/Geolocation/window-close-crash.html
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkSourceWebKit2ChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (1292=
51 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebKit2/ChangeLog 2012-09-21 21:02:=
37 UTC (rev 129251)
+++ trunk/Source/WebKit2/ChangeLog 2012-09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -1,3 +1,20 @@
</span><ins>+2012-09-21 Benjamin Poulain <bpoulain at apple.com>
+
+ [WK2] Add basic testing support for Geolocation
+ https://bugs.webkit.org/show_bug.cgi?id=3D97278
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * 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 work=
ing around the normal
+ Geolocation code and updating all the GeolocationController, whi=
ch is a terrible idea.
+
</ins><span class=3D"cx"> 2012-09-21 Alexey Proskuryakov <ap at apple.c=
om>
</span><span class=3D"cx">=20
</span><span class=3D"cx"> [WK2] Make Web Inspector work in multi=
ple web process mode
</span></span></pre></div>
<a id=3D"trunkSourceWebKit2SharedAPIcWKNumberh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebKit2/Shared/API/c/WK=
Number.h (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebKit2/Shared/API/c/WKNumber.h 201=
2-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Source/WebKit2/Shared/API/c/WKNumber.h 2012-09-21 21:06:05 UTC =
(rev 129252)
</span><span class=3D"lines">@@ -45,7 +45,7 @@
</span><span class=3D"cx"> /* WKUInt64 */
</span><span class=3D"cx"> WK_EXPORT WKTypeID WKUInt64GetTypeID();
</span><span class=3D"cx"> WK_EXPORT WKUInt64Ref WKUInt64Create(uint64_t =
value);
</span><del>-WK_EXPORT uint64_t WKUInt64GetValue(WKUInt64Ref doubleRef);
</del><ins>+WK_EXPORT uint64_t WKUInt64GetValue(WKUInt64Ref integerRef);
</ins><span class=3D"cx">=20
</span><span class=3D"cx"> #ifdef __cplusplus
</span><span class=3D"cx"> }
</span></span></pre></div>
<a id=3D"trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlecpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Inje=
ctedBundle/API/c/WKBundle.cpp (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/A=
PI/c/WKBundle.cpp 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp 201=
2-09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -162,11 +162,6 @@
</span><span class=3D"cx"> toImpl(bundleRef)->setPluginsEnabled(to=
Impl(pageGroupRef), enabled);
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-void WKBundleSetGeolocationPermission(WKBundleRef bundleRef,=
WKBundlePageGroupRef pageGroupRef, bool enabled)
-{
- toImpl(bundleRef)->setGeoLocationPermission(toImpl(pageGroupRef),=
enabled);
-}
-
</del><span class=3D"cx"> void WKBundleSetJavaScriptCanAccessClipboard(WK=
BundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, bool enabled)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> toImpl(bundleRef)->setJavaScriptCanAcce=
ssClipboard(toImpl(pageGroupRef), enabled);
</span></span></pre></div>
<a id=3D"trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePrivateh">=
</a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Inje=
ctedBundle/API/c/WKBundlePrivate.h (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/A=
PI/c/WKBundlePrivate.h 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePrivate.=
h 2012-09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -60,7 +60,6 @@
</span><span class=3D"cx"> WK_EXPORT void WKBundleSetMinimumLogicalFontSi=
ze(WKBundleRef bundleRef, WKBundlePageGroupRef pageGroupRef, int size);
</span><span class=3D"cx"> WK_EXPORT void WKBundleSetFrameFlatteningEnabl=
ed(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
</span><span class=3D"cx"> WK_EXPORT void WKBundleSetPluginsEnabled(WKBun=
dleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
</span><del>-WK_EXPORT void WKBundleSetGeolocationPermission(WKBundleRef =
bundle, WKBundlePageGroupRef pageGroup, bool enabled);
</del><span class=3D"cx"> WK_EXPORT void WKBundleSetJavaScriptCanAccessCl=
ipboard(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled)=
;
</span><span class=3D"cx"> WK_EXPORT void WKBundleSetPrivateBrowsingEnabl=
ed(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
</span><span class=3D"cx"> WK_EXPORT void WKBundleSetPopupBlockingEnabled=
(WKBundleRef bundle, WKBundlePageGroupRef pageGroup, bool enabled);
</span></span></pre></div>
<a id=3D"trunkSourceWebKit2WebProcessInjectedBundleInjectedBundlecpp"></a=
>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Inje=
ctedBundle/InjectedBundle.cpp (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/I=
njectedBundle.cpp 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp 201=
2-09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -248,18 +248,6 @@
</span><span class=3D"cx"> (*iter)->settings()->setPluginsE=
nabled(enabled);
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-void InjectedBundle::setGeoLocationPermission(WebPageGroupPr=
oxy* pageGroup, bool enabled)
-{
-#if ENABLE(GEOLOCATION)
- const HashSet<Page*>& pages =3D PageGroup::pageGroup(pageG=
roup->identifier())->pages();
- for (HashSet<Page*>::iterator iter =3D pages.begin(); iter !=3D=
pages.end(); ++iter)
- static_cast<GeolocationClientMock*>(GeolocationController:=
:from(*iter)->client())->setPermission(enabled);
-#else
- UNUSED_PARAM(pageGroup);
- UNUSED_PARAM(enabled);
-#endif // ENABLE(GEOLOCATION)
-}
-
</del><span class=3D"cx"> void InjectedBundle::setJavaScriptCanAccessClip=
board(WebPageGroupProxy* pageGroup, bool enabled)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> const HashSet<Page*>& pages =3D =
PageGroup::pageGroup(pageGroup->identifier())->pages();
</span></span></pre></div>
<a id=3D"trunkSourceWebKit2WebProcessInjectedBundleInjectedBundleh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Inje=
ctedBundle/InjectedBundle.h (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/I=
njectedBundle.h 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/InjectedBundle.h 2012-=
09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -111,7 +111,6 @@
</span><span class=3D"cx"> void setMinimumLogicalFontSize(WebPageGrou=
pProxy*, int size);
</span><span class=3D"cx"> void setFrameFlatteningEnabled(WebPageGrou=
pProxy*, bool);
</span><span class=3D"cx"> void setPluginsEnabled(WebPageGroupProxy*,=
bool);
</span><del>- void setGeoLocationPermission(WebPageGroupProxy*, bool);
</del><span class=3D"cx"> void setJavaScriptCanAccessClipboard(WebPag=
eGroupProxy*, bool);
</span><span class=3D"cx"> void setPrivateBrowsingEnabled(WebPageGrou=
pProxy*, bool);
</span><span class=3D"cx"> void setPopupBlockingEnabled(WebPageGroupP=
roxy*, bool);
</span></span></pre></div>
<a id=3D"trunkToolsChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/ChangeLog (129251 =3D> 1=
29252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/ChangeLog 2012-09-21 21:02:37 UTC (r=
ev 129251)
+++ trunk/Tools/ChangeLog 2012-09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -1,3 +1,60 @@
</span><ins>+2012-09-21 Benjamin Poulain <bpoulain at apple.com>
+
+ [WK2] Add basic testing support for Geolocation
+ https://bugs.webkit.org/show_bug.cgi?id=3D97278
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Update the Geolocation testing to use the proper API in the UIPr=
ocess.
+
+ * 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 th=
em 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 WebP=
rocess 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 UIPr=
ocess so that
+ GeolocationProvider and the TestController can respond appropria=
tely.
+
+ * 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:
+
</ins><span class=3D"cx"> 2012-09-21 Joanmarie Diggs <jdiggs at igalia.=
com>
</span><span class=3D"cx">=20
</span><span class=3D"cx"> REGRESSION (r127882): accessibility/sp=
inbutton-value.html failing on GTK
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerCMakeListstxt"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/CMakeLi=
sts.txt (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/CMakeLists.txt 2012=
-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/CMakeLists.txt 2012-09-21 21:06:05 UTC (=
rev 129252)
</span><span class=3D"lines">@@ -5,6 +5,7 @@
</span><span class=3D"cx">=20
</span><span class=3D"cx"> SET(WebKitTestRunner_SOURCES
</span><span class=3D"cx"> ${WEBKIT_TESTRUNNER_DIR}/CyclicRedundancyC=
heck.cpp
</span><ins>+ ${WEBKIT_TESTRUNNER_DIR}/GeolocationProviderMock.cpp
</ins><span class=3D"cx"> ${WEBKIT_TESTRUNNER_DIR}/PixelDumpSupport.c=
pp
</span><span class=3D"cx"> ${WEBKIT_TESTRUNNER_DIR}/TestController.cp=
p
</span><span class=3D"cx"> ${WEBKIT_TESTRUNNER_DIR}/TestInvocation.cp=
p
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerGNUmakefileam"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/GNUmake=
file.am (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/GNUmakefile.am 2012=
-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/GNUmakefile.am 2012-09-21 21:06:05 UTC (=
rev 129252)
</span><span class=3D"lines">@@ -19,6 +19,8 @@
</span><span class=3D"cx"> Tools/WebKitTestRunner/cairo/TestInvocationCa=
iro.cpp \
</span><span class=3D"cx"> Tools/WebKitTestRunner/CyclicRedundancyCheck.=
cpp \
</span><span class=3D"cx"> Tools/WebKitTestRunner/CyclicRedundancyCheck.=
h \
</span><ins>+ Tools/WebKitTestRunner/GeolocationProviderMock.cpp \
+ Tools/WebKitTestRunner/GeolocationProviderMock.h \
</ins><span class=3D"cx"> Tools/WebKitTestRunner/PixelDumpSupport.cpp \
</span><span class=3D"cx"> Tools/WebKitTestRunner/PixelDumpSupport.h \
</span><span class=3D"cx"> Tools/WebKitTestRunner/PlatformWebView.h \
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerGeolocationProviderMockcpp"></a>
<div class=3D"addfile"><h4>Added: trunk/Tools/WebKitTestRunner/Geolocatio=
nProviderMock.cpp (0 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/GeolocationProvider=
Mock.cpp (rev 0)
+++ trunk/Tools/WebKitTestRunner/GeolocationProviderMock.cpp 2012-09-21 2=
1:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * 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 th=
e
+ * documentation and/or other materials provided with the distributio=
n.
+ *
+ * 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 PARTICULA=
R
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUT=
ORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, O=
R
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSIN=
ESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER =
IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS=
E)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED O=
F
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GeolocationProviderMock.h"
+
+#include <WebKit2/WKGeolocationManager.h>
+#include <wtf/Assertions.h>
+#include <wtf/CurrentTime.h>
+
+namespace WTR {
+
+static void startUpdatingCallback(WKGeolocationManagerRef geolocationMan=
ager, const void* clientInfo)
+{
+ GeolocationProviderMock* geolocationProvider =3D static_cast<Geol=
ocationProviderMock*>(const_cast<void*>(clientInfo));
+ geolocationProvider->startUpdating(geolocationManager);
+}
+
+static void stopUpdatingCallback(WKGeolocationManagerRef geolocationMana=
ger, const void* clientInfo)
+{
+ GeolocationProviderMock* geolocationProvider =3D static_cast<Geol=
ocationProviderMock*>(const_cast<void*>(clientInfo));
+ geolocationProvider->stopUpdating(geolocationManager);
+}
+
+GeolocationProviderMock::GeolocationProviderMock(WKContextRef context)
+ : m_isActive(false)
+{
+ m_geolocationManager =3D WKContextGetGeolocationManager(context);
+
+ WKGeolocationProvider providerCallback =3D {
+ kWKGeolocationProviderCurrentVersion,
+ this,
+ startUpdatingCallback,
+ stopUpdatingCallback };
+ WKGeolocationManagerSetProvider(m_geolocationManager, &providerC=
allback);
+}
+
+void GeolocationProviderMock::setMockGeolocationPosition(double latitude=
, double longitude, double accuracy)
+{
+ m_position.adopt(WKGeolocationPositionCreate(currentTime(), latitude=
, longitude, accuracy));
+ if (m_isActive)
+ WKGeolocationManagerProviderDidChangePosition(m_geolocationManag=
er, m_position.get());
+}
+
+void GeolocationProviderMock::startUpdating(WKGeolocationManagerRef geol=
ocationManager)
+{
+ ASSERT_UNUSED(geolocationManager, geolocationManager =3D=3D m_geoloc=
ationManager);
+
+ m_isActive =3D true;
+ if (m_position)
+ WKGeolocationManagerProviderDidChangePosition(m_geolocationManag=
er, m_position.get());
+}
+
+void GeolocationProviderMock::stopUpdating(WKGeolocationManagerRef geolo=
cationManager)
+{
+ ASSERT_UNUSED(geolocationManager, geolocationManager =3D=3D m_geoloc=
ationManager);
+
+ m_isActive =3D false;
+}
+
+} // namespace WTR
</ins></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerGeolocationProviderMockh"></a>
<div class=3D"addfile"><h4>Added: trunk/Tools/WebKitTestRunner/Geolocatio=
nProviderMock.h (0 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/GeolocationProvider=
Mock.h (rev 0)
+++ trunk/Tools/WebKitTestRunner/GeolocationProviderMock.h 2012-09-21 21:=
06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * 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 th=
e
+ * documentation and/or other materials provided with the distributio=
n.
+ *
+ * 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 PARTICULA=
R
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUT=
ORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, O=
R
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSIN=
ESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER =
IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWIS=
E)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED O=
F
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GeolocationProviderMock_h
+#define GeolocationProviderMock_h
+
+#include <WebKit2/WKRetainPtr.h>
+
+namespace WTR {
+
+class GeolocationProviderMock {
+public:
+ GeolocationProviderMock(WKContextRef);
+
+ void setMockGeolocationPosition(double latitude, double longitude, d=
ouble accuracy);
+
+ void startUpdating(WKGeolocationManagerRef);
+ void stopUpdating(WKGeolocationManagerRef);
+
+private:
+ WKGeolocationManagerRef m_geolocationManager;
+ bool m_isActive;
+
+ WKRetainPtr<WKGeolocationPositionRef> m_position;
+};
+
+} // namespace WTR
+
+#endif // GeolocationProviderMock_h
</ins></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerInjectedBundleBindingsTestRunneridl"><=
/a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/Injecte=
dBundle/Bindings/TestRunner.idl (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Bind=
ings/TestRunner.idl 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl 2=
012-09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -60,7 +60,6 @@
</span><span class=3D"cx"> void setAllowFileAccessFromFileURLs(in=
boolean value);
</span><span class=3D"cx"> void setFrameFlatteningEnabled(in bool=
ean value);
</span><span class=3D"cx"> void setPluginsEnabled(in boolean valu=
e);
</span><del>- void setGeolocationPermission(in boolean value);
</del><span class=3D"cx"> void setJavaScriptCanAccessClipboard(in=
boolean value);
</span><span class=3D"cx"> void setPrivateBrowsingEnabled(in bool=
ean value);
</span><span class=3D"cx"> void setPopupBlockingEnabled(in boolea=
n value);
</span><span class=3D"lines">@@ -179,6 +178,10 @@
</span><span class=3D"cx"> void removeAllWebNotificationPermissio=
ns();
</span><span class=3D"cx"> void simulateWebNotificationClick(in o=
bject notification);
</span><span class=3D"cx">=20
</span><ins>+ // Geolocation
+ void setGeolocationPermission(in boolean value);
+ void setMockGeolocationPosition(in double latitude, in double lo=
ngitude, in double accuracy);
+
</ins><span class=3D"cx"> boolean callShouldCloseOnWebView();
</span><span class=3D"cx"> };
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlecpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/Injecte=
dBundle/InjectedBundle.cpp (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Inje=
ctedBundle.cpp 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp 2012-0=
9-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -358,4 +358,32 @@
</span><span class=3D"cx"> WKBundlePostMessage(m_bundle, messageName.=
get(), messageBody.get());
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><ins>+void InjectedBundle::setGeolocationPermission(bool enabled)
+{
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWi=
thUTF8CString("SetGeolocationPermission"));
+ WKRetainPtr<WKBooleanRef> messageBody(AdoptWK, WKBooleanCreate=
(enabled));
+ WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+}
+
+void InjectedBundle::setMockGeolocationPosition(double latitude, double =
longitude, double accuracy)
+{
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWi=
thUTF8CString("SetMockGeolocationPosition"));
+
+ WKRetainPtr<WKMutableDictionaryRef> messageBody(AdoptWK, WKMut=
ableDictionaryCreate());
+
+ WKRetainPtr<WKStringRef> latitudeKeyWK(AdoptWK, WKStringCreate=
WithUTF8CString("latitude"));
+ WKRetainPtr<WKDoubleRef> latitudeWK(AdoptWK, WKDoubleCreate(la=
titude));
+ WKDictionaryAddItem(messageBody.get(), latitudeKeyWK.get(), latitude=
WK.get());
+
+ WKRetainPtr<WKStringRef> longitudeKeyWK(AdoptWK, WKStringCreat=
eWithUTF8CString("longitude"));
+ WKRetainPtr<WKDoubleRef> longitudeWK(AdoptWK, WKDoubleCreate(l=
ongitude));
+ WKDictionaryAddItem(messageBody.get(), longitudeKeyWK.get(), longitu=
deWK.get());
+
+ WKRetainPtr<WKStringRef> accuracyKeyWK(AdoptWK, WKStringCreate=
WithUTF8CString("accuracy"));
+ WKRetainPtr<WKDoubleRef> accuracyWK(AdoptWK, WKDoubleCreate(ac=
curacy));
+ WKDictionaryAddItem(messageBody.get(), accuracyKeyWK.get(), accuracy=
WK.get());
+
+ WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+}
+
</ins><span class=3D"cx"> } // namespace WTR
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerInjectedBundleInjectedBundleh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/Injecte=
dBundle/InjectedBundle.h (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Inje=
ctedBundle.h 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h 2012-09-=
21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -90,6 +90,10 @@
</span><span class=3D"cx"> void postSetWindowIsKey(bool);
</span><span class=3D"cx"> void postSimulateWebNotificationClick(uint=
64_t notificationID);
</span><span class=3D"cx">=20
</span><ins>+ // Geolocation.
+ void setGeolocationPermission(bool);
+ void setMockGeolocationPosition(double latitude, double longitude, d=
ouble accuracy);
+
</ins><span class=3D"cx"> private:
</span><span class=3D"cx"> InjectedBundle();
</span><span class=3D"cx"> ~InjectedBundle();
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerInjectedBundleTestRunnercpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/Injecte=
dBundle/TestRunner.cpp (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Test=
Runner.cpp 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp 2012-09-21=
21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -393,11 +393,6 @@
</span><span class=3D"cx"> WKBundleSetPluginsEnabled(InjectedBundle::=
shared().bundle(), InjectedBundle::shared().pageGroup(), enabled);
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-void TestRunner::setGeolocationPermission(bool enabled)
-{
- WKBundleSetGeolocationPermission(InjectedBundle::shared().bundle(), =
InjectedBundle::shared().pageGroup(), enabled);
-}
-
</del><span class=3D"cx"> void TestRunner::setJavaScriptCanAccessClipboar=
d(bool enabled)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> WKBundleSetJavaScriptCanAccessClipboard(I=
njectedBundle::shared().bundle(), InjectedBundle::shared().pageGroup(), e=
nabled);
</span><span class=3D"lines">@@ -772,6 +767,17 @@
</span><span class=3D"cx"> InjectedBundle::shared().postSimulateWebNo=
tificationClick(notificationID);
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><ins>+void TestRunner::setGeolocationPermission(bool enabled)
+{
+ // FIXME: this should be done by frame.
+ InjectedBundle::shared().setGeolocationPermission(enabled);
+}
+
+void TestRunner::setMockGeolocationPosition(double latitude, double long=
itude, double accuracy)
+{
+ InjectedBundle::shared().setMockGeolocationPosition(latitude, longit=
ude, accuracy);
+}
+
</ins><span class=3D"cx"> bool TestRunner::callShouldCloseOnWebView()
</span><span class=3D"cx"> {
</span><span class=3D"cx"> WKBundleFrameRef mainFrame =3D WKBundlePag=
eGetMainFrame(InjectedBundle::shared().page()->page());
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerInjectedBundleTestRunnerh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/Injecte=
dBundle/TestRunner.h (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/Test=
Runner.h 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h 2012-09-21 2=
1:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -98,7 +98,6 @@
</span><span class=3D"cx"> void setAllowFileAccessFromFileURLs(bool);
</span><span class=3D"cx"> void setFrameFlatteningEnabled(bool);
</span><span class=3D"cx"> void setPluginsEnabled(bool);
</span><del>- void setGeolocationPermission(bool);
</del><span class=3D"cx"> void setJavaScriptCanAccessClipboard(bool);
</span><span class=3D"cx"> void setPrivateBrowsingEnabled(bool);
</span><span class=3D"cx"> void setPopupBlockingEnabled(bool);
</span><span class=3D"lines">@@ -248,6 +247,10 @@
</span><span class=3D"cx"> void removeAllWebNotificationPermissions()=
;
</span><span class=3D"cx"> void simulateWebNotificationClick(JSValueR=
ef notification);
</span><span class=3D"cx">=20
</span><ins>+ // Geolocation.
+ void setGeolocationPermission(bool);
+ void setMockGeolocationPosition(double latitude, double longitude, d=
ouble accuracy);
+
</ins><span class=3D"cx"> JSRetainPtr<JSStringRef> platformName=
();
</span><span class=3D"cx">=20
</span><span class=3D"cx"> void setPageVisibility(JSStringRef state);
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerTargetpri"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/Target.=
pri (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/Target.pri 2012-09-=
21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/Target.pri 2012-09-21 21:06:05 UTC (rev =
129252)
</span><span class=3D"lines">@@ -10,6 +10,7 @@
</span><span class=3D"cx"> HEADERS +=3D \
</span><span class=3D"cx"> $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/q=
t/QtInitializeTestFonts.h \
</span><span class=3D"cx"> EventSenderProxy.h \
</span><ins>+ GeolocationProviderMock.h \
</ins><span class=3D"cx"> PlatformWebView.h \
</span><span class=3D"cx"> StringFunctions.h \
</span><span class=3D"cx"> TestController.h \
</span><span class=3D"lines">@@ -23,6 +24,7 @@
</span><span class=3D"cx"> qt/PlatformWebViewQt.cpp \
</span><span class=3D"cx"> qt/TestControllerQt.cpp \
</span><span class=3D"cx"> qt/TestInvocationQt.cpp \
</span><ins>+ GeolocationProviderMock.cpp \
</ins><span class=3D"cx"> TestController.cpp \
</span><span class=3D"cx"> TestInvocation.cpp \
</span><span class=3D"cx"> WebNotificationProvider.cpp
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerTestControllercpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestCon=
troller.cpp (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/TestController.cpp =
2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/TestController.cpp 2012-09-21 21:06:05 U=
TC (rev 129252)
</span><span class=3D"lines">@@ -91,6 +91,7 @@
</span><span class=3D"cx"> , m_didPrintWebProcessCrashedMessage(false=
)
</span><span class=3D"cx"> , m_shouldExitWhenWebProcessCrashes(true)
</span><span class=3D"cx"> , m_beforeUnloadReturnValue(true)
</span><ins>+ , m_isGeolocationPermissionAllowed(false)
</ins><span class=3D"cx"> #if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(G=
TK) || PLATFORM(EFL)
</span><span class=3D"cx"> , m_eventSenderProxy(new EventSenderProxy(=
this))
</span><span class=3D"cx"> #endif
</span><span class=3D"lines">@@ -170,6 +171,15 @@
</span><span class=3D"cx"> view->setWindowIsKey(false);
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><ins>+static void decidePolicyForGeolocationPermissionRequest(WKPa=
geRef, WKFrameRef, WKSecurityOriginRef, WKGeolocationPermissionRequestRef=
permissionRequest, const void* clientInfo)
+{
+ TestController* testController =3D static_cast<TestController*>=
;(const_cast<void*>(clientInfo));
+ if (testController->isGeolocationPermissionAllowed())
+ WKGeolocationPermissionRequestAllow(permissionRequest);
+ else
+ WKGeolocationPermissionRequestDeny(permissionRequest);
+}
+
</ins><span class=3D"cx"> WKPageRef TestController::createOtherPage(WKPag=
eRef oldPage, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEvent=
MouseButton, const void*)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> PlatformWebView* view =3D new PlatformWebV=
iew(WKPageGetContext(oldPage), WKPageGetPageGroup(oldPage));
</span><span class=3D"lines">@@ -209,7 +219,7 @@
</span><span class=3D"cx"> 0, // pageDidScroll
</span><span class=3D"cx"> exceededDatabaseQuota,
</span><span class=3D"cx"> 0, // runOpenPanel
</span><del>- 0, // decidePolicyForGeolocationPermissionRequest
</del><ins>+ decidePolicyForGeolocationPermissionRequest,
</ins><span class=3D"cx"> 0, // headerHeight
</span><span class=3D"cx"> 0, // footerHeight
</span><span class=3D"cx"> 0, // drawHeader
</span><span class=3D"lines">@@ -318,6 +328,7 @@
</span><span class=3D"cx"> m_pageGroup.adopt(WKPageGroupCreateWithIde=
ntifier(pageGroupIdentifier.get()));
</span><span class=3D"cx">=20
</span><span class=3D"cx"> m_context.adopt(WKContextCreateWithInjecte=
dBundlePath(injectedBundlePath()));
</span><ins>+ m_geolocationProvider =3D adoptPtr(new GeolocationProvid=
erMock(m_context.get()));
</ins><span class=3D"cx">=20
</span><span class=3D"cx"> const char* path =3D libraryPathForTesting=
();
</span><span class=3D"cx"> if (path) {
</span><span class=3D"lines">@@ -379,7 +390,7 @@
</span><span class=3D"cx"> 0, // pageDidScroll
</span><span class=3D"cx"> exceededDatabaseQuota,
</span><span class=3D"cx"> 0, // runOpenPanel
</span><del>- 0, // decidePolicyForGeolocationPermissionRequest
</del><ins>+ decidePolicyForGeolocationPermissionRequest,
</ins><span class=3D"cx"> 0, // headerHeight
</span><span class=3D"cx"> 0, // footerHeight
</span><span class=3D"cx"> 0, // drawHeader
</span><span class=3D"lines">@@ -988,6 +999,11 @@
</span><span class=3D"cx"> m_webNotificationProvider.simulateWebNotif=
icationClick(notificationID);
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><ins>+void TestController::setMockGeolocationPosition(double latit=
ude, double longitude, double accuracy)
+{
+ m_geolocationProvider->setMockGeolocationPosition(latitude, longi=
tude, accuracy);
+}
+
</ins><span class=3D"cx"> void TestController::decidePolicyForNotificatio=
nPermissionRequest(WKPageRef page, WKSecurityOriginRef origin, WKNotifica=
tionPermissionRequestRef request, const void* clientInfo)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> static_cast<TestController*>(const_c=
ast<void*>(clientInfo))->decidePolicyForNotificationPermissionRe=
quest(page, origin, request);
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerTestControllerh"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestCon=
troller.h (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/TestController.h 20=
12-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/TestController.h 2012-09-21 21:06:05 UTC=
(rev 129252)
</span><span class=3D"lines">@@ -27,6 +27,7 @@
</span><span class=3D"cx"> #define TestController_h
</span><span class=3D"cx">=20
</span><span class=3D"cx"> #include "WebNotificationProvider.h"
</span><ins>+#include <GeolocationProviderMock.h>
</ins><span class=3D"cx"> #include <WebKit2/WKRetainPtr.h>
</span><span class=3D"cx"> #include <string>
</span><span class=3D"cx"> #include <vector>
</span><span class=3D"lines">@@ -65,6 +66,11 @@
</span><span class=3D"cx">=20
</span><span class=3D"cx"> void simulateWebNotificationClick(uint64_t=
notificationID);
</span><span class=3D"cx">=20
</span><ins>+ // Geolocation.
+ void setGeolocationPermission(bool enabled) { m_isGeolocationPermiss=
ionAllowed =3D enabled; }
+ bool isGeolocationPermissionAllowed() const { return m_isGeolocation=
PermissionAllowed; }
+ void setMockGeolocationPosition(double latitude, double longitude, d=
ouble accuracy);
+
</ins><span class=3D"cx"> bool resetStateToConsistentValues();
</span><span class=3D"cx">=20
</span><span class=3D"cx"> private:
</span><span class=3D"lines">@@ -123,6 +129,7 @@
</span><span class=3D"cx"> OwnPtr<PlatformWebView> m_mainWebVie=
w;
</span><span class=3D"cx"> WKRetainPtr<WKContextRef> m_context;
</span><span class=3D"cx"> WKRetainPtr<WKPageGroupRef> m_pageGr=
oup;
</span><ins>+ OwnPtr<GeolocationProviderMock> m_geolocationProvi=
der;
</ins><span class=3D"cx">=20
</span><span class=3D"cx"> enum State {
</span><span class=3D"cx"> Initial,
</span><span class=3D"lines">@@ -143,6 +150,8 @@
</span><span class=3D"cx"> =20
</span><span class=3D"cx"> bool m_beforeUnloadReturnValue;
</span><span class=3D"cx">=20
</span><ins>+ bool m_isGeolocationPermissionAllowed;
+
</ins><span class=3D"cx"> EventSenderProxy* m_eventSenderProxy;
</span><span class=3D"cx"> };
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerTestInvocationcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/TestInv=
ocation.cpp (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/TestInvocation.cpp =
2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/TestInvocation.cpp 2012-09-21 21:06:05 U=
TC (rev 129252)
</span><span class=3D"lines">@@ -346,6 +346,33 @@
</span><span class=3D"cx"> return;
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><ins>+ if (WKStringIsEqualToUTF8CString(messageName, "SetG=
eolocationPermission")) {
+ ASSERT(WKGetTypeID(messageBody) =3D=3D WKBooleanGetTypeID());
+ WKBooleanRef enabledWK =3D static_cast<WKBooleanRef>(messa=
geBody);
+ TestController::shared().setGeolocationPermission(WKBooleanGetVa=
lue(enabledWK));
+ return;
+ }
+
+ if (WKStringIsEqualToUTF8CString(messageName, "SetMockGeolocati=
onPosition")) {
+ ASSERT(WKGetTypeID(messageBody) =3D=3D WKDictionaryGetTypeID());
+ WKDictionaryRef messageBodyDictionary =3D static_cast<WKDicti=
onaryRef>(messageBody);
+
+ WKRetainPtr<WKStringRef> latitudeKeyWK(AdoptWK, WKStringCr=
eateWithUTF8CString("latitude"));
+ WKDoubleRef latitudeWK =3D static_cast<WKDoubleRef>(WKDict=
ionaryGetItemForKey(messageBodyDictionary, latitudeKeyWK.get()));
+ double latitude =3D WKDoubleGetValue(latitudeWK);
+
+ WKRetainPtr<WKStringRef> longitudeKeyWK(AdoptWK, WKStringC=
reateWithUTF8CString("longitude"));
+ WKDoubleRef longitudeWK =3D static_cast<WKDoubleRef>(WKDic=
tionaryGetItemForKey(messageBodyDictionary, longitudeKeyWK.get()));
+ double longitude =3D WKDoubleGetValue(longitudeWK);
+
+ WKRetainPtr<WKStringRef> accuracyKeyWK(AdoptWK, WKStringCr=
eateWithUTF8CString("accuracy"));
+ WKDoubleRef accuracyWK =3D static_cast<WKDoubleRef>(WKDict=
ionaryGetItemForKey(messageBodyDictionary, accuracyKeyWK.get()));
+ double accuracy =3D WKDoubleGetValue(accuracyWK);
+
+ TestController::shared().setMockGeolocationPosition(latitude, lo=
ngitude, accuracy);
+ return;
+ }
+
</ins><span class=3D"cx"> ASSERT_NOT_REACHED();
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerWebKitTestRunnerxcodeprojprojectpbxpro=
j"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/WebKitT=
estRunner.xcodeproj/project.pbxproj (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/WebKitTestRunner.xc=
odeproj/project.pbxproj 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxpr=
oj 2012-09-21 21:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -23,6 +23,7 @@
</span><span class=3D"cx"> /* Begin PBXBuildFile section */
</span><span class=3D"cx"> 0F5169CB1445222D00E0A9D7 /* WebKit.framework=
in Frameworks */ =3D {isa =3D PBXBuildFile; fileRef =3D 0F5169CA1445222D=
00E0A9D7 /* WebKit.framework */; };
</span><span class=3D"cx"> 0F5169CC1445222D00E0A9D7 /* WebKit.framework=
in Frameworks */ =3D {isa =3D PBXBuildFile; fileRef =3D 0F5169CA1445222D=
00E0A9D7 /* WebKit.framework */; };
</span><ins>+ 26D758E7160BECDD00268472 /* GeolocationProviderMock.cpp in=
Sources */ =3D {isa =3D PBXBuildFile; fileRef =3D 26D758E5160BECDC002684=
72 /* GeolocationProviderMock.cpp */; };
</ins><span class=3D"cx"> 29210EAE144CACB700835BB5 /* AccessibilityUIEl=
ement.cpp in Sources */ =3D {isa =3D PBXBuildFile; fileRef =3D 29210EA914=
4CACB200835BB5 /* AccessibilityUIElement.cpp */; };
</span><span class=3D"cx"> 29210EB0144CACBD00835BB5 /* AccessibilityCon=
troller.cpp in Sources */ =3D {isa =3D PBXBuildFile; fileRef =3D 29210EA2=
144CAAA500835BB5 /* AccessibilityController.cpp */; };
</span><span class=3D"cx"> 29210EB4144CACD500835BB5 /* AccessibilityTex=
tMarker.cpp in Sources */ =3D {isa =3D PBXBuildFile; fileRef =3D 29210EB1=
144CACD400835BB5 /* AccessibilityTextMarker.cpp */; };
</span><span class=3D"lines">@@ -100,6 +101,8 @@
</span><span class=3D"cx">=20
</span><span class=3D"cx"> /* Begin PBXFileReference section */
</span><span class=3D"cx"> 0F5169CA1445222D00E0A9D7 /* WebKit.framework=
*/ =3D {isa =3D PBXFileReference; lastKnownFileType =3D wrapper.framewor=
k; path =3D WebKit.framework; sourceTree =3D BUILT_PRODUCTS_DIR; };
</span><ins>+ 26D758E5160BECDC00268472 /* GeolocationProviderMock.cpp */=
=3D {isa =3D PBXFileReference; fileEncoding =3D 4; lastKnownFileType =3D=
sourcecode.cpp.cpp; path =3D GeolocationProviderMock.cpp; sourceTree =3D=
"<group>"; };
+ 26D758E6160BECDD00268472 /* GeolocationProviderMock.h */ =3D {isa =3D =
PBXFileReference; fileEncoding =3D 4; lastKnownFileType =3D sourcecode.c.=
h; path =3D GeolocationProviderMock.h; sourceTree =3D "<group>=
"; };
</ins><span class=3D"cx"> 29210EA2144CAAA500835BB5 /* AccessibilityCont=
roller.cpp */ =3D {isa =3D PBXFileReference; fileEncoding =3D 4; lastKnow=
nFileType =3D sourcecode.cpp.cpp; path =3D AccessibilityController.cpp; s=
ourceTree =3D "<group>"; };
</span><span class=3D"cx"> 29210EA3144CAAA500835BB5 /* AccessibilityCon=
troller.h */ =3D {isa =3D PBXFileReference; fileEncoding =3D 4; lastKnown=
FileType =3D sourcecode.c.h; path =3D AccessibilityController.h; sourceTr=
ee =3D "<group>"; };
</span><span class=3D"cx"> 29210EA8144CAB8800835BB5 /* AccessibilityCon=
troller.idl */ =3D {isa =3D PBXFileReference; fileEncoding =3D 4; lastKno=
wnFileType =3D text; path =3D AccessibilityController.idl; sourceTree =3D=
"<group>"; };
</span><span class=3D"lines">@@ -255,6 +258,8 @@
</span><span class=3D"cx"> 5322FB4113FDA0CD0041ABCC /* CyclicRedundan=
cyCheck.cpp */,
</span><span class=3D"cx"> 5322FB4213FDA0CD0041ABCC /* CyclicRedundan=
cyCheck.h */,
</span><span class=3D"cx"> 5670B8261386FC13002EB355 /* EventSenderPro=
xy.h */,
</span><ins>+ 26D758E5160BECDC00268472 /* GeolocationProviderMock.cpp =
*/,
+ 26D758E6160BECDD00268472 /* GeolocationProviderMock.h */,
</ins><span class=3D"cx"> 5322FB4413FDA0EA0041ABCC /* PixelDumpSuppor=
t.cpp */,
</span><span class=3D"cx"> 5322FB4513FDA0EA0041ABCC /* PixelDumpSuppo=
rt.h */,
</span><span class=3D"cx"> BC7934DD119066EC005EA8E2 /* PlatformWebVie=
w.h */,
</span><span class=3D"lines">@@ -565,6 +570,7 @@
</span><span class=3D"cx"> files =3D (
</span><span class=3D"cx"> BC793400118F7C84005EA8E2 /* main.mm in Sou=
rces */,
</span><span class=3D"cx"> 5322FB4313FDA0CD0041ABCC /* CyclicRedundan=
cyCheck.cpp in Sources */,
</span><ins>+ 26D758E7160BECDD00268472 /* GeolocationProviderMock.cpp =
in Sources */,
</ins><span class=3D"cx"> 5322FB4613FDA0EA0041ABCC /* PixelDumpSuppor=
t.cpp in Sources */,
</span><span class=3D"cx"> BC7934E811906846005EA8E2 /* PlatformWebVie=
wMac.mm in Sources */,
</span><span class=3D"cx"> BC793431118F7F19005EA8E2 /* TestController=
.cpp in Sources */,
</span></span></pre></div>
<a id=3D"trunkToolsWebKitTestRunnerwinWebKitTestRunnervcproj"></a>
<div class=3D"modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/win/Web=
KitTestRunner.vcproj (129251 =3D> 129252)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Tools/WebKitTestRunner/win/WebKitTestRunne=
r.vcproj 2012-09-21 21:02:37 UTC (rev 129251)
+++ trunk/Tools/WebKitTestRunner/win/WebKitTestRunner.vcproj 2012-09-21 2=
1:06:05 UTC (rev 129252)
</span><span class=3D"lines">@@ -479,6 +479,14 @@
</span><span class=3D"cx"> >
</span><span class=3D"cx"> </File>
</span><span class=3D"cx"> <File
</span><ins>+ RelativePath=3D"..\GeolocationProviderMock.cpp"
+ >
+ </File>
+ <File
+ RelativePath=3D"..\GeolocationProviderMock.h"
+ >
+ </File>
+ <File
</ins><span class=3D"cx"> RelativePath=3D"..\PixelDumpSupport.cpp=
"
</span><span class=3D"cx"> >
</span><span class=3D"cx"> </File>
</span></span></pre>
</div>
</div>
</body>
</html>
More information about the webkit-changes
mailing list