[Webkit-unassigned] [Bug 39081] [chromium] Adds supports for layout tests using GeolocationServiceMock

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 14 08:42:19 PDT 2010


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





--- Comment #5 from Marcus Bulach <bulach at chromium.org>  2010-05-14 08:42:19 PST ---
thanks for the quick reply, Steve!
replies inline:

(In reply to comment #3)
> (From update of attachment 56011 [details])
> Can you explain why this is needed? As far as I can see, GeolocationServiceChromiumMock is an intermediate that sits between the existing GeolocationServiceMock and the Geolocation object. Does this class exist solely to add the extra calls to GeolocationServiceChromium::startUpdating()/stopUpdating()?
> 
> It looks like GeolocationServiceChromiumMock is mostly boilerplate - could it be reduced by having it inherit from GeolocationServiceMock, rather than owning an instance?

sorry, I tried to keep the minimalistic comment style here, but obviously it needs some clarifications.. :) let me know what's the best way to add (ChangeLog? inline comments?)
anyways: there are extensive comments on the other side:
http://codereview.chromium.org/2094003/diff/5001/6001

basically: there are a few layers up in the embedder that require a GeolocationServiceChromium (for getBridgeId() / attachBridgeIfNeeded).

hence, the simplest way seemed to extend that expected object/interface, and delegate the calls to GeolocationServiceMock as appropriate..

so yes, it's just an intermediary proxy that sits between Geolocation and the embedder. it's all boiler plate code to adapt what the embedder expects to what the mock provides, and to inject in a Geolocation object.

> 
> > diff --git a/WebCore/platform/GeolocationService.cpp b/WebCore/platform/GeolocationService.cpp
> > +void GeolocationService::useMockFactory(FactoryFunction f)
> > +{
> > +    s_mockFactoryFunction = f;
> > +    useMock();
> >  }
> So we need to call useMock() here, as it's called from setPosition and setError? Would a better name for this function then be 'setCustomMock'?

renamed to setCustomMockFactory, and moved the "useMock()" call from here to higher up.

-- 
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