Re: [webkit-dev] Why are the mock implementations in WebCore/platform?
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. Steve -- Google UK Limited Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ Registered in England Number: 3977902 ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] Why are the mock implementations in WebCore/platform?
It seems reasonable to keep mock objects that act solely as the back end to platform/ classes in platform/. I believe Sam was commenting specifically on mock objects that know about things outside platform/. The specific example given was not (afaict) a client interfance. I think it's reasonable to segregate all the mock objects, since their dependencies in general are not limited to platform/, and it doesn't seem great to scatter them around the tree. Refactoring some of the mock objects to reduce dependencies is another possibility, but probably more complicated. It would be good to fix the layering in the meantime as Sam suggested. - Maciej On Nov 26, 2010, at 11:20 AM, Adam Barth wrote: Originally, I thought it made sense to mock out pieces of the platform abstraction that didn't exist in all ports (e.g., GPS sensors). I'm not sure why you'd want to mock out a client interface. Can't you just implement the client interface in DRT? Adam On Fri, Nov 26, 2010 at 10:33 AM, Sam Weinig sam.wei...@gmail.com wrote: Just a general question as to why the decision was made to put the mock implementation classes (DeviceOrientationClientMock, GeolocationServiceMock and SpeechInputClientMock) beneath WebCore/platform. WebCore/platform is not supposed to know about classes outside of WebCore/platform in WebCore (such as DeviceOrientationController) and this seems to be perpetuating the laying violation. Perhaps a top-level WebCore/mock/ would be preferable. - Sam ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
[webkit-dev] Why are the mock implementations in WebCore/platform?
Just a general question as to why the decision was made to put the mock implementation classes (DeviceOrientationClientMock, GeolocationServiceMock and SpeechInputClientMock) beneath WebCore/platform. WebCore/platform is not supposed to know about classes outside of WebCore/platform in WebCore (such as DeviceOrientationController) and this seems to be perpetuating the laying violation. Perhaps a top-level WebCore/mock/ would be preferable. - Sam ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] Why are the mock implementations in WebCore/platform?
Note that it's still a bit of an open question as to where mocks should live in general. IIRC, the top candidates are like device orientation and speech do now, somehow in some central place but not compiled into production libraries, or in DRT (which means more copied code, but the platform layers will be better exercised). It would be nice to get this resolved once and for all and get the code cleaned up. J On Fri, Nov 26, 2010 at 6:33 PM, Sam Weinig sam.wei...@gmail.com wrote: Just a general question as to why the decision was made to put the mock implementation classes (DeviceOrientationClientMock, GeolocationServiceMock and SpeechInputClientMock) beneath WebCore/platform. WebCore/platform is not supposed to know about classes outside of WebCore/platform in WebCore (such as DeviceOrientationController) and this seems to be perpetuating the laying violation. Perhaps a top-level WebCore/mock/ would be preferable. - Sam ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
Re: [webkit-dev] Why are the mock implementations in WebCore/platform?
Originally, I thought it made sense to mock out pieces of the platform abstraction that didn't exist in all ports (e.g., GPS sensors). I'm not sure why you'd want to mock out a client interface. Can't you just implement the client interface in DRT? Adam On Fri, Nov 26, 2010 at 10:33 AM, Sam Weinig sam.wei...@gmail.com wrote: Just a general question as to why the decision was made to put the mock implementation classes (DeviceOrientationClientMock, GeolocationServiceMock and SpeechInputClientMock) beneath WebCore/platform. WebCore/platform is not supposed to know about classes outside of WebCore/platform in WebCore (such as DeviceOrientationController) and this seems to be perpetuating the laying violation. Perhaps a top-level WebCore/mock/ would be preferable. - Sam ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev ___ webkit-dev mailing list webkit-dev@lists.webkit.org http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev