[webkit-dev] Why are the mock implementations in WebCore/platform?

Steve Block steveblock at google.com
Tue Dec 14 04:31:18 PST 2010

> Just a general question as to why the decision was made to put the mock
> implementation classes (DeviceOrientationClientMock, GeolocationServiceMock
> and SpeechInputClientMock) beneath WebCore/platform.
I added the first mock class, GeolocationServiceMock , to allow
Geolocation to be tested in LayoutTests. At the time, the
(non-client-based) Geolocation implementation lived in
WebCore/platform, so it was suggested I create a new mock directory -
https://bugs.webkit.org/show_bug.cgi?id=28264#c5. Since then, new
mocks have been added to the same directory.

However, these newer mock classes, such as
DeviceOrientationClientMock, are for client interfaces, so I agree
that it no longer makes sense for them to live in WebCore/platform.
This includes GeolocationClientMock, which is the mock for the newer
client-based Geolocation implementation to which we are in the process
of switching - https://bugs.webkit.org/show_bug.cgi?id=40373

> I'm not sure why you'd want to mock out a client interface.  Can't you
> just implement the client interface in DRT?
The idea behind the mocks for the client interfaces is to provide
shared code which can be used by all ports' implementations of DRT to
give reliable behaviour for LayoutTests.

> Perhaps a top-level WebCore/mock/ would be preferable.
That sounds reasonable, or perhaps WebKit/mock, as these are
implementations of WebCore client interfaces to be used by DRT.


Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902

More information about the webkit-dev mailing list