[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 18:25:13 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 51d3357c68ef568545170ed39fc9a0ff7fd8a5c6
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Dec 10 18:54:10 2010 +0000

    2010-12-10  John Knottenbelt  <jknotten at chromium.org>
    
            Reviewed by Steve Block.
    
            [Chromium] Implement mocks for client-based geolocation
            https://bugs.webkit.org/show_bug.cgi?id=46895
    
            * WebKit.gyp:
            * public/WebGeolocationClientMock.h: Added.
            (WebKit::WebGeolocationClientMock::~WebGeolocationClientMock):
            (WebKit::WebGeolocationClientMock::WebGeolocationClientMock):
            * src/WebGeolocationClientMock.cpp: Added.
            (WebKit::WebGeolocationClientMock::create):
            (WebKit::WebGeolocationClientMock::initialize):
            (WebKit::WebGeolocationClientMock::reset):
            (WebKit::WebGeolocationClientMock::setMockGeolocationPosition):
            (WebKit::WebGeolocationClientMock::setMockGeolocationError):
            (WebKit::WebGeolocationClientMock::setMockGeolocationPermission):
            (WebKit::WebGeolocationClientMock::resetMock):
            (WebKit::WebGeolocationClientMock::startUpdating):
            (WebKit::WebGeolocationClientMock::stopUpdating):
            (WebKit::WebGeolocationClientMock::setEnableHighAccuracy):
            (WebKit::WebGeolocationClientMock::geolocationDestroyed):
            (WebKit::WebGeolocationClientMock::setController):
            (WebKit::WebGeolocationClientMock::lastPosition):
            (WebKit::WebGeolocationClientMock::requestPermission):
            (WebKit::WebGeolocationClientMock::cancelPermissionRequest):
            * src/WebGeolocationServiceMock.cpp:
    2010-12-10  John Knottenbelt  <jknotten at chromium.org>
    
            Reviewed by Steve Block.
    
            [Chromium] Implement mocks for client-based geolocation
            https://bugs.webkit.org/show_bug.cgi?id=46895
    
            * DumpRenderTree/chromium/LayoutTestController.cpp:
            (LayoutTestController::setGeolocationPermission):
            (LayoutTestController::setMockGeolocationPosition):
            (LayoutTestController::setMockGeolocationError):
            * DumpRenderTree/chromium/LayoutTestController.h:
            * DumpRenderTree/chromium/WebViewHost.cpp:
            (WebViewHost::geolocationClient):
            (WebViewHost::geolocationClientMock):
            (WebViewHost::reset):
            * DumpRenderTree/chromium/WebViewHost.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73745 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 8164d6b..4f08996 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -2,6 +2,35 @@
 
         Reviewed by Steve Block.
 
+        [Chromium] Implement mocks for client-based geolocation
+        https://bugs.webkit.org/show_bug.cgi?id=46895
+
+        * WebKit.gyp:
+        * public/WebGeolocationClientMock.h: Added.
+        (WebKit::WebGeolocationClientMock::~WebGeolocationClientMock):
+        (WebKit::WebGeolocationClientMock::WebGeolocationClientMock):
+        * src/WebGeolocationClientMock.cpp: Added.
+        (WebKit::WebGeolocationClientMock::create):
+        (WebKit::WebGeolocationClientMock::initialize):
+        (WebKit::WebGeolocationClientMock::reset):
+        (WebKit::WebGeolocationClientMock::setMockGeolocationPosition):
+        (WebKit::WebGeolocationClientMock::setMockGeolocationError):
+        (WebKit::WebGeolocationClientMock::setMockGeolocationPermission):
+        (WebKit::WebGeolocationClientMock::resetMock):
+        (WebKit::WebGeolocationClientMock::startUpdating):
+        (WebKit::WebGeolocationClientMock::stopUpdating):
+        (WebKit::WebGeolocationClientMock::setEnableHighAccuracy):
+        (WebKit::WebGeolocationClientMock::geolocationDestroyed):
+        (WebKit::WebGeolocationClientMock::setController):
+        (WebKit::WebGeolocationClientMock::lastPosition):
+        (WebKit::WebGeolocationClientMock::requestPermission):
+        (WebKit::WebGeolocationClientMock::cancelPermissionRequest):
+        * src/WebGeolocationServiceMock.cpp:
+
+2010-12-10  John Knottenbelt  <jknotten at chromium.org>
+
+        Reviewed by Steve Block.
+
         [chromium] Implement client based geolocation bindings
         https://bugs.webkit.org/show_bug.cgi?id=45752
 
diff --git a/WebKit/chromium/WebKit.gyp b/WebKit/chromium/WebKit.gyp
index cbea04d..bd8f4a5 100644
--- a/WebKit/chromium/WebKit.gyp
+++ b/WebKit/chromium/WebKit.gyp
@@ -174,6 +174,7 @@
                 'public/WebFormControlElement.h',
                 'public/WebFormElement.h',
                 'public/WebGeolocationClient.h',
+                'public/WebGeolocationClientMock.h',
                 'public/WebGeolocationController.h',
                 'public/WebGeolocationError.h',
                 'public/WebGeolocationPermissionRequest.h',
@@ -451,6 +452,7 @@
                 'src/WebFrameImpl.cpp',
                 'src/WebFrameImpl.h',
                 'src/WebGeolocationController.cpp',
+                'src/WebGeolocationClientMock.cpp',
                 'src/WebGeolocationError.cpp',
                 'src/WebGeolocationPermissionRequest.cpp',
                 'src/WebGeolocationPermissionRequestManager.cpp',
@@ -676,7 +678,6 @@
                 ['"ENABLE_CLIENT_BASED_GEOLOCATION=1" in feature_defines', {
                     'sources/': [
                         ['exclude', 'WebGeolocationService.*$'],
-                        ['include', 'WebGeolocationServiceMock.*'],
                     ],
                 }, {
                    'sources/': [
@@ -866,6 +867,11 @@
                         },
                     },
                 }],
+                ['"ENABLE_CLIENT_BASED_GEOLOCATION=1" in feature_defines', {
+                    'sources/': [
+                        ['exclude', 'WebGeolocationService.*$'],
+                    ],
+                }]
             ],
         },
         {
diff --git a/WebKit/chromium/public/WebGeolocationClientMock.h b/WebKit/chromium/public/WebGeolocationClientMock.h
new file mode 100644
index 0000000..08a85e2
--- /dev/null
+++ b/WebKit/chromium/public/WebGeolocationClientMock.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2010, Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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.
+ */
+
+#ifndef WebGeolocationClientMock_h
+#define WebGeolocationClientMock_h
+
+#include "WebCommon.h"
+#include "WebGeolocationClient.h"
+#include "WebPrivateOwnPtr.h"
+
+namespace WebCore {
+class GeolocationClientMock;
+}
+
+namespace WebKit {
+class WebGeolocationPosition;
+class WebString;
+
+class WebGeolocationClientMock : public WebGeolocationClient {
+public:
+    WEBKIT_API static WebGeolocationClientMock* create();
+    ~WebGeolocationClientMock() { reset(); }
+
+    WEBKIT_API void setPosition(double latitude, double longitude, double accuracy);
+    WEBKIT_API void setError(int errorCode, const WebString& message);
+    WEBKIT_API void setPermission(bool);
+    WEBKIT_API void resetMock();
+
+    virtual void startUpdating();
+    virtual void stopUpdating();
+    virtual void setEnableHighAccuracy(bool);
+
+    virtual void geolocationDestroyed();
+    virtual void setController(WebGeolocationController*);
+
+    virtual void requestPermission(const WebGeolocationPermissionRequest&);
+    virtual void cancelPermissionRequest(const WebGeolocationPermissionRequest&);
+
+    virtual bool lastPosition(WebGeolocationPosition& webPosition);
+
+private:
+    WebGeolocationClientMock();
+    WEBKIT_API void reset();
+
+    WebPrivateOwnPtr<WebCore::GeolocationClientMock> m_clientMock;
+};
+}
+
+#endif // WebGeolocationClientMock_h
diff --git a/WebKit/chromium/src/WebGeolocationClientMock.cpp b/WebKit/chromium/src/WebGeolocationClientMock.cpp
new file mode 100644
index 0000000..1ec3dd1
--- /dev/null
+++ b/WebKit/chromium/src/WebGeolocationClientMock.cpp
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2010, Google 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:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * 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.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
+ * OWNER OR 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 "WebGeolocationClientMock.h"
+
+#include "CurrentTime.h"
+#include "Geolocation.h"
+#include "GeolocationClientMock.h"
+#include "GeolocationError.h"
+#include "GeolocationPosition.h"
+#include "PositionError.h"
+#include "WebGeolocationController.h"
+#include "WebGeolocationError.h"
+#include "WebGeolocationPermissionRequest.h"
+#include "WebGeolocationPosition.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebGeolocationClientMock* WebGeolocationClientMock::create()
+{
+    return new WebGeolocationClientMock();
+}
+
+void WebGeolocationClientMock::setPosition(double latitude, double longitude, double accuracy)
+{
+    WebGeolocationPosition webPosition(currentTime(), latitude, longitude, accuracy,
+                                       false, 0, false, 0, false, 0, false, 0);
+    m_clientMock->setPosition(webPosition);
+}
+
+void WebGeolocationClientMock::setError(int errorCode, const WebString& message)
+{
+    WebGeolocationError::Error code;
+    switch (errorCode) {
+    case PositionError::PERMISSION_DENIED:
+        code = WebGeolocationError::ErrorPermissionDenied;
+        break;
+    case PositionError::POSITION_UNAVAILABLE:
+        code = WebGeolocationError::ErrorPositionUnavailable;
+        break;
+    default:
+        ASSERT_NOT_REACHED();
+        return;
+    }
+
+    WebGeolocationError webError(code, message);
+    m_clientMock->setError(webError);
+}
+
+void WebGeolocationClientMock::setPermission(bool allowed)
+{
+    m_clientMock->setPermission(allowed);
+}
+
+void WebGeolocationClientMock::resetMock()
+{
+    m_clientMock->reset();
+}
+
+void WebGeolocationClientMock::startUpdating()
+{
+    m_clientMock->startUpdating();
+}
+
+void WebGeolocationClientMock::stopUpdating()
+{
+    m_clientMock->stopUpdating();
+}
+
+void WebGeolocationClientMock::setEnableHighAccuracy(bool accuracy)
+{
+    m_clientMock->setEnableHighAccuracy(accuracy);
+}
+
+void WebGeolocationClientMock::geolocationDestroyed()
+{
+    m_clientMock->geolocationDestroyed();
+}
+
+void WebGeolocationClientMock::setController(WebGeolocationController* controller)
+{
+    m_clientMock->setController(controller->controller());
+    delete controller;
+}
+
+void WebGeolocationClientMock::requestPermission(const WebGeolocationPermissionRequest& request)
+{
+    m_clientMock->requestPermission(request.geolocation());
+}
+
+void WebGeolocationClientMock::cancelPermissionRequest(const WebGeolocationPermissionRequest& request)
+{
+    m_clientMock->cancelPermissionRequest(request.geolocation());
+}
+
+bool WebGeolocationClientMock::lastPosition(WebGeolocationPosition& webPosition)
+{
+    RefPtr<GeolocationPosition> position = m_clientMock->lastPosition();
+    if (!position)
+        return false;
+
+    webPosition = position.release();
+    return true;
+}
+
+WebGeolocationClientMock::WebGeolocationClientMock()
+{
+    m_clientMock.reset(new GeolocationClientMock());
+}
+
+void WebGeolocationClientMock::reset()
+{
+    m_clientMock.reset(0);
+}
+
+} // WebKit
diff --git a/WebKit/chromium/src/WebGeolocationServiceMock.cpp b/WebKit/chromium/src/WebGeolocationServiceMock.cpp
index 07d3f44..667b8b1 100644
--- a/WebKit/chromium/src/WebGeolocationServiceMock.cpp
+++ b/WebKit/chromium/src/WebGeolocationServiceMock.cpp
@@ -41,39 +41,6 @@
 #include <wtf/Vector.h>
 
 #if ENABLE(GEOLOCATION)
-
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
-// FIXME: Implement mock bindings for client-based geolocation. Ultimately
-// move to another class and remove WebGeolocationService*.
-
-namespace WebKit {
-
-class WebGeolocationServiceMockClientBasedImpl : public WebGeolocationServiceMock {
-};
-
-WebGeolocationServiceMock* WebGeolocationServiceMock::createWebGeolocationServiceMock()
-{
-    return new WebGeolocationServiceMockClientBasedImpl;
-}
-
-void WebGeolocationServiceMock::setMockGeolocationPermission(bool allowed)
-{
-    // FIXME: Implement mock binding
-}
-
-void WebGeolocationServiceMock::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
-{
-    // FIXME: Implement mock binding
-}
-
-void WebGeolocationServiceMock::setMockGeolocationError(int errorCode, const WebString& message)
-{
-    // FIXME: Implement mock binding
-}
-
-} // namespace WebKit
-
-#else
 using WebCore::Coordinates;
 using WebCore::Frame;
 using WebCore::Geolocation;
@@ -272,6 +239,4 @@ void WebGeolocationServiceMockImpl::notifyPendingPermissions()
 }
 
 } // namespace WebKit
-
-#endif // ENABLE(CLIENT_BASED_GEOLOCATION)
 #endif // ENABLE(GEOLOCATION)
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 5ab92e4..212a587 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-10  John Knottenbelt  <jknotten at chromium.org>
+
+        Reviewed by Steve Block.
+
+        [Chromium] Implement mocks for client-based geolocation
+        https://bugs.webkit.org/show_bug.cgi?id=46895
+
+        * DumpRenderTree/chromium/LayoutTestController.cpp:
+        (LayoutTestController::setGeolocationPermission):
+        (LayoutTestController::setMockGeolocationPosition):
+        (LayoutTestController::setMockGeolocationError):
+        * DumpRenderTree/chromium/LayoutTestController.h:
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::geolocationClient):
+        (WebViewHost::geolocationClientMock):
+        (WebViewHost::reset):
+        * DumpRenderTree/chromium/WebViewHost.h:
+
 2010-12-10  Alejandro G. Castro  <alex at igalia.com>
 
         Reviewed by Martin Robinson.
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
index a55070e..d252c63 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.cpp
@@ -43,7 +43,11 @@
 #include "WebDocument.h"
 #include "WebElement.h"
 #include "WebFrame.h"
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+#include "WebGeolocationClientMock.h"
+#else
 #include "WebGeolocationServiceMock.h"
+#endif
 #include "WebInputElement.h"
 #include "WebKit.h"
 #include "WebNotificationPresenter.h"
@@ -1513,7 +1517,11 @@ void LayoutTestController::setGeolocationPermission(const CppArgumentList& argum
     result->setNull();
     if (arguments.size() < 1 || !arguments[0].isBool())
         return;
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+    m_shell->webViewHost()->geolocationClientMock()->setPermission(arguments[0].toBoolean());
+#else
     WebGeolocationServiceMock::setMockGeolocationPermission(arguments[0].toBoolean());
+#endif
 }
 
 void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arguments, CppVariant* result)
@@ -1521,7 +1529,11 @@ void LayoutTestController::setMockGeolocationPosition(const CppArgumentList& arg
     result->setNull();
     if (arguments.size() < 3 || !arguments[0].isNumber() || !arguments[1].isNumber() || !arguments[2].isNumber())
         return;
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+    m_shell->webViewHost()->geolocationClientMock()->setPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble());
+#else
     WebGeolocationServiceMock::setMockGeolocationPosition(arguments[0].toDouble(), arguments[1].toDouble(), arguments[2].toDouble());
+#endif
 }
 
 void LayoutTestController::setMockGeolocationError(const CppArgumentList& arguments, CppVariant* result)
@@ -1529,7 +1541,11 @@ void LayoutTestController::setMockGeolocationError(const CppArgumentList& argume
     result->setNull();
     if (arguments.size() < 2 || !arguments[0].isNumber() || !arguments[1].isString())
         return;
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+    m_shell->webViewHost()->geolocationClientMock()->setError(arguments[0].toInt32(), cppVariantToWebString(arguments[1]));
+#else
     WebGeolocationServiceMock::setMockGeolocationError(arguments[0].toInt32(), cppVariantToWebString(arguments[1]));
+#endif
 }
 
 void LayoutTestController::abortModal(const CppArgumentList& arguments, CppVariant* result)
diff --git a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
index 7581781..03affa3 100644
--- a/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
+++ b/WebKitTools/DumpRenderTree/chromium/LayoutTestController.h
@@ -49,6 +49,7 @@
 #include <wtf/OwnPtr.h>
 
 namespace WebKit {
+class WebGeolocationClientMock;
 class WebSpeechInputController;
 class WebSpeechInputControllerMock;
 class WebSpeechInputListener;
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
index 6b97c74..10a2823 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.cpp
@@ -43,7 +43,11 @@
 #include "WebDragData.h"
 #include "WebElement.h"
 #include "WebFrame.h"
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+#include "WebGeolocationClientMock.h"
+#else
 #include "WebGeolocationServiceMock.h"
+#endif
 #include "WebHistoryItem.h"
 #include "WebNode.h"
 #include "WebRange.h"
@@ -571,10 +575,22 @@ WebNotificationPresenter* WebViewHost::notificationPresenter()
     return m_shell->notificationPresenter();
 }
 
-#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+WebKit::WebGeolocationClient* WebViewHost::geolocationClient()
+{
+    return geolocationClientMock();
+}
+
+WebKit::WebGeolocationClientMock* WebViewHost::geolocationClientMock()
+{
+    if (!m_geolocationClientMock)
+        m_geolocationClientMock.set(WebGeolocationClientMock::create());
+    return m_geolocationClientMock.get();
+}
+#else
 WebKit::WebGeolocationService* WebViewHost::geolocationService()
 {
-    if (!m_geolocationServiceMock.get())
+    if (!m_geolocationServiceMock)
         m_geolocationServiceMock.set(WebGeolocationServiceMock::createWebGeolocationServiceMock());
     return m_geolocationServiceMock.get();
 }
@@ -1171,7 +1187,10 @@ void WebViewHost::reset()
     m_editCommandName.clear();
     m_editCommandValue.clear();
 
-#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+    if (m_geolocationClientMock.get())
+        m_geolocationClientMock->resetMock();
+#else
     m_geolocationServiceMock.clear();
 #endif
 
diff --git a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
index c8595b3..20b29c0 100644
--- a/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
+++ b/WebKitTools/DumpRenderTree/chromium/WebViewHost.h
@@ -48,6 +48,8 @@ namespace WebKit {
 class WebFrame;
 class WebDeviceOrientationClient;
 class WebDeviceOrientationClientMock;
+class WebGeolocationClient;
+class WebGeolocationClientMock;
 class WebGeolocationServiceMock;
 class WebSpeechInputController;
 class WebSpeechInputControllerMock;
@@ -137,7 +139,9 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
     virtual int historyForwardListCount();
     virtual void postAccessibilityNotification(const WebKit::WebAccessibilityObject&, WebKit::WebAccessibilityNotification);
     virtual WebKit::WebNotificationPresenter* notificationPresenter();
-#if !ENABLE(CLIENT_BASED_GEOLOCATION)
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+    virtual WebKit::WebGeolocationClient* geolocationClient();
+#else
     virtual WebKit::WebGeolocationService* geolocationService();
 #endif
     virtual WebKit::WebSpeechInputController* speechInputController(WebKit::WebSpeechInputListener*);
@@ -206,6 +210,11 @@ class WebViewHost : public WebKit::WebViewClient, public WebKit::WebFrameClient,
     WebKit::WebDeviceOrientationClientMock* deviceOrientationClientMock();
     MockSpellCheck* mockSpellCheck();
 
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+    // Geolocation client mocks for LayoutTestController
+    WebKit::WebGeolocationClientMock* geolocationClientMock();
+#endif
+
 private:
     LayoutTestController* layoutTestController() const;
 
@@ -307,8 +316,10 @@ private:
 
     OwnPtr<WebKit::WebContextMenuData> m_lastContextMenuData;
 
-#if !ENABLE(CLIENT_BASED_GEOLOCATION)
     // Geolocation
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+    OwnPtr<WebKit::WebGeolocationClientMock> m_geolocationClientMock;
+#else
     OwnPtr<WebKit::WebGeolocationServiceMock> m_geolocationServiceMock;
 #endif
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list