2009-09-07 Steve Block <steveblock@google.com>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Sep 2009 06:13:55 +0000 (06:13 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Sep 2009 06:13:55 +0000 (06:13 +0000)
commit3390ec1e836c09b75f8df7da853e0615e51f6a97
treeb83422fb722c7b87efc5b9ced911d94eb72080e6
parent14a29efc8779ad11455c856cfdf36da76a4229d3
2009-09-07  Steve Block  <steveblock@google.com>

        Reviewed by Adam Barth.

        Adds a mock Geolocation service. This will be used to provide predictable behavior of the
        Geolocation API for use in LayoutTests. Later changes will integrate the the mock
        Geolocation service with DumpRenderTree.
        https://bugs.webkit.org/show_bug.cgi?id=28264

        * fast/dom/Geolocation/resources/error.js: Added. Tests that the error callback is called when the service reports an error.
        * fast/dom/Geolocation/error-expected.txt: Added. Expected result for above test.
        * fast/dom/Geolocation/error.html: Added. Wrapper for above test.
2009-09-07  Steve Block  <steveblock@google.com>

        Reviewed by Adam Barth.

        Adds a mock Geolocation service. This will be used to provide predictable behavior of the
        Geolocation API for use in LayoutTests. Later changes will integrate the the mock
        Geolocation service with DumpRenderTree.
        https://bugs.webkit.org/show_bug.cgi?id=28264

        The mock Geolocation service returns a fixed position or error. This position or error can be
        set through static methods on the GeolocationService class. The position or error is shared
        between all instances of the mock Geolocation service.

        Implementation details.
        The GeolocationService object maintains a pointer to a factory function which it uses to create
        Geolocation service instances. Each platform implementing Geolocation sets this pointer
        to the factory function for their platform's implementation. When the mock Geolocation service
        is activated, the factory function pointer is reset to the factory function for the mock service.

        Test: fast/dom/Geolocation/error.html

        * WebCore.base.exp: Modified. Exports GeolocationServiceMock methods.
        * GNUMakefile.am: Modified. Added GeolocationServiceMock files.
        * WebCore.gypi: Modified. Added GeolocationServiceMock files.
        * WebCore.pro: Modified. Added GeolocationServiceMock files.
        * WebCore.vcproj/WebCore.vcproj: Modified. Added GeolocationServiceMock files.
        * WebCore.vcproj/WebCoreCommon.vsprops: Modified. Added mock directory to includes.
        * WebCore.xcodeproj/project.pbxproj: Modified. Added GeolocationServiceMock files and exports some headers.
        * WebCoreSources.bkl: Modified. Added GeolocationServiceMock files.
        * page/ChromeClient.h: Modified. Fixed comment.
        * page/Geolocation.cpp: Modified.
        (WebCore::Geolocation::setIsAllowed): Modified. Fixed error string.
        * platform/GeolocationService.cpp: Modified.
        (WebCore::createGeolocationServiceNull): Added. Returns null in place of a Geolocation service. Used to avoid link errors on platforms where Geolocation is not implemented.
        (WebCore::GeolocationService::create): Added. Uses the factory function pointer to create a Geolocation service implementation.
        (WebCore::GeolocationService::useMock): Added. Configures the GeolocationServie to use the mock implementation.
        * platform/GeolocationService.h: Modified.
        * platform/mock: Added.
        * platform/mock/GeolocationServiceMock.cpp: Added.
        (WebCore::GeolocationServiceMock::create): Added. Creates a GeolocationServiceMock object.
        (WebCore::GeolocationServiceMock::GeolocationServiceMock): Added. Constructor.
        (WebCore::GeolocationServiceMock::~GeolocationServiceMock): Added. Destructor.
        (WebCore::GeolocationServiceMock::setPosition): Added. Sets the position that will be returned by the object.
        (WebCore::GeolocationServiceMock::setError): Added. Sets the error that will be returned by the object.
        (WebCore::GeolocationServiceMock::startUpdating): Added. GeolocationService implementation. Starts the service.
        (WebCore::GeolocationServiceMock::stopUpdating): Added. GeolocationService implementation. Stops the service.
        (WebCore::GeolocationServiceMock::timerFired): Added. Used to provide an asynchronous callback when the service is started.
        (WebCore::GeolocationServiceMock::makeGeolocationCallbackFromAllInstances): Added. Used to call back when the position or error is updated.
        (WebCore::GeolocationServiceMock::makeGeolocationCallback): Added. Used to call back when the service starts.
        (WebCore::GeolocationServiceMock::initStatics): Added. Initializes statics members with constructors.
        (WebCore::GeolocationServiceMock::cleanUpStatics): Added. Cleans up static members with constructors.
        * platform/mock/GeolocationServiceMock.h: Added.
        (WebCore::GeolocationServiceMock::lastPosition): Added. Returns the fixed position.
        (WebCore::GeolocationServiceMock::lastError): Added. Returns the fixed error.
        * platform/gtk/GeolocationServiceGtk.cpp: Modified.
        (WebCore::GeolocationServiceGtk::create): Added. Creates an instance of GeolocationServiceGtk.
        * platform/gtk/GeolocationServiceGtk.h: Modified.
        * platform/mac/GeolocationServiceMac.h: Modified.
        * platform/mac/GeolocationServiceMac.mm: Modified.
        (WebCore::GeolocationServiceMac::create): Added. Creates an instance of GeolocationServiceMac.
2009-09-07  Steve Block  <steveblock@google.com>

        Reviewed by Adam Barth.

        Adds a mock Geolocation service. This will be used to provide predictable behavior of the
        Geolocation API for use in LayoutTests. Later changes will integrate the the mock
        Geolocation service with DumpRenderTree.
        https://bugs.webkit.org/show_bug.cgi?id=28264

        * WebKit.xcodeproj/project.pbxproj: Modified. Adds WebGeolocationMock.
2009-09-07  Steve Block  <steveblock@google.com>

        Reviewed by Adam Barth.

        Adds a mock Geolocation service. This will be used to provide predictable behavior of the
        Geolocation API for use in LayoutTests. Later changes will integrate the the mock
        Geolocation service with DumpRenderTree.
        https://bugs.webkit.org/show_bug.cgi?id=28264

        * WebCoreSupport/WebGeolocationMockPrivate.h: Added.
        * WebCoreSupport/WebGeolocationMock.mm: Added.
        (+[WebGeolocationMock setError:code:]): Added. Used by DumpRender tree to configure the mock Geolocation service.
        (+[WebGeolocationMock setPosition:latitude:longitude:accuracy:]): Added. Used by DumpRender tree to configure the mock Geolocation service.
        * WebKit.exp: Modified. Exports WebGeolocationMock.
2009-09-07  Steve Block  <steveblock@google.com>

        Reviewed by Adam Barth.

        Adds a mock Geolocation service. This will be used to provide predictable behavior of the
        Geolocation API for use in LayoutTests. Later changes will integrate the the mock
        Geolocation service with DumpRenderTree.
        https://bugs.webkit.org/show_bug.cgi?id=28264

        * DumpRenderTree/LayoutTestController.cpp: Modified.
        (setMockGeolocationPositionCallback): Added. Configures the mock Geolocation service.
        (setMockGeolocationErrorCallback): Added. Configures the mock Geolocation service.
        (LayoutTestController::staticFunctions): Added. Registers the above functions on the LayoutTestController.
        * DumpRenderTree/LayoutTestController.h: Modified.
        * DumpRenderTree/mac/LayoutTestControllerMac.mm: Modified.
        (LayoutTestController::setMockGeolocationPosition): Added. Configures the mock Geolocation service.
        (LayoutTestController::setMockGeolocationError): Added. Configures the mock Geolocation service.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@48144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
37 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/dom/Geolocation/error-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Geolocation/error.html [new file with mode: 0644]
LayoutTests/fast/dom/Geolocation/resources/error.js [new file with mode: 0644]
LayoutTests/platform/gtk/Skipped
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.base.exp
WebCore/WebCore.gypi
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.vcproj/WebCoreCommon.vsprops
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/page/ChromeClient.h
WebCore/page/Geolocation.cpp
WebCore/platform/GeolocationService.cpp
WebCore/platform/GeolocationService.h
WebCore/platform/gtk/GeolocationServiceGtk.cpp
WebCore/platform/gtk/GeolocationServiceGtk.h
WebCore/platform/mac/GeolocationServiceMac.h
WebCore/platform/mac/GeolocationServiceMac.mm
WebCore/platform/mock/GeolocationServiceMock.cpp [new file with mode: 0644]
WebCore/platform/mock/GeolocationServiceMock.h [new file with mode: 0644]
WebKit/ChangeLog
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebGeolocationMock.mm [new file with mode: 0644]
WebKit/mac/WebCoreSupport/WebGeolocationMockPrivate.h [new file with mode: 0644]
WebKit/mac/WebKit.exp
WebKitTools/ChangeLog
WebKitTools/DumpRenderTree/LayoutTestController.cpp
WebKitTools/DumpRenderTree/LayoutTestController.h
WebKitTools/DumpRenderTree/gtk/LayoutTestControllerGtk.cpp
WebKitTools/DumpRenderTree/mac/LayoutTestControllerMac.mm
WebKitTools/DumpRenderTree/win/LayoutTestControllerWin.cpp
WebKitTools/DumpRenderTree/wx/LayoutTestControllerWx.cpp