[Webkit-unassigned] [Bug 28264] Add Mock Geolocation service for use in LayoutTests

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 2 03:33:57 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=28264





--- Comment #4 from steveblock at google.com  2009-09-02 03:33:57 PDT ---
> Does WebCore have other Mock classes?  This should probably live in
> WebKitTools/DumpRenderTree
I don't see any other mocks in WebCore. Is there a pattern for mocks in
DumpRenderTree that I can follow?

> What's the benefit of holding all that data in the Mock class as statics versus
> just holding them as members of the instance?
The GeolocationService instance is created when the page's Geolocation instance
is created. This is created lazily in Navogator::Geolocation() when
navigator.geolocation is first accessed. So if we want to use
MockGeolocationService, we have to configure WebCore to do so before
navigator.geolocation is accessed. So GeolocationService::useMock method must
be static.

The advantage of making the lastPosition and lastError members of
MockGeolocationService static, is that it allows us to easily configure
MockGeolocationService when GeolocationService::useMock is called.

Alternatively, LayoutTestController.setMockGeolocationPosition could call
GeolocationService::useMock, then create the page's Geolocation object (if it
didn't already exist), then configure its MockGeolocationService. This would
require extra plumbing to allow the LayoutTestController to get the Navigator
object for the current frame, and modifications to Geolocation to allow the
LayoutTestController to get the GeolocationService it creates.

This is possible, but seemed like a less neat solution, given the changes
required.

> I'm not really sure what the best approach is here.  We should consult with
> some WebCore/platform experts on the best way to test against mock platform
> features.
OK, I'll ask on #webkit. Do you have any suggestions as to who to approach?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list