[webkit-dev] Clients and the Page constructor

Andrei Popescu andreip at google.com
Thu Jul 22 04:33:23 PDT 2010

On Wed, Jul 21, 2010 at 8:57 PM, Steve Block <steveblock at google.com> wrote:
> Another argument for the setter is that it makes it easier to inject a
> mock for testing in response to a LayoutTestController method call, by
> simply calling the setter again to replace the real client with a mock
> client. Personally, however, I think that this is somewhat abusing the
> idea of setting a client. If the real implementation needs to be
> switched for a mock at runtime in DRT, this should probably be handled
> by the client itself - so the same client is used throughout the
> lifetime of the Page.

Furthermore, none of the cases that I am familiar with (Geolocation,
Device Orientation, speech) require to start in DRT with a real client
implementation and then, later, switch to a mock in response to some
DRT method call. They all can quite happily pass the mock client
pointer in the Page ctor. So the mock injection argument you mention
above is for a problem that does not exist in reality.


More information about the webkit-dev mailing list