[Webkit-unassigned] [Bug 39589] Add LayoutTestController methods to test DeviceOrientation

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 16 03:54:45 PDT 2010


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


Steve Block <steveblock at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bulach at chromium.org




--- Comment #2 from Steve Block <steveblock at google.com>  2010-07-16 03:54:45 PST ---
This patch isn't complete but I'd value some feedback on the structure I've used to provide the mock implementation, as I don't think there's much precedent to follow. The only other instance of a mock that's configurable from LayoutTestController that I'm aware of is Geolocation, and that's currently in turmoil as we have two parallel implementations.

My intention is to provide a platform-independent mock for DeviceOrientationClient. This will ensure that all platforms use the same mock for consistency in testing. At the same time, the way in which the mock is inserted is left up to the platform.

Included in the patch is DeviceOrientationClientAndroid, to provide an example. It acts as a proxy to the real DeviceOrientationClient, which is owned by the WebViewCore. In normal use, the WebViewCore provides DeviceOrientationClientImpl, but provides DeviceOrientationClientMock when required in DumpRenderTree.

Currently, the decision of whether to use the mock is delayed until the corresponding LayoutTestController method is called. This allows LayoutTests which use both the real implementation and the mock implementation.

An alternative would be to have the WebViewCore simply provide either DeviceOrientationClientImpl or DeviceOrientationClientMock when instantiating the Page object, thus eliminating the DeviceOrientationClientAndroid proxy. The disadvantage of this approach is that the decision to use the mock would then have to be made at start-up time. DumpRenderTree would have to set the use of the mock when configuring the WebViewCore. This means that no layout tests can use the real DeviceOrientationClient implementation.

In reality, I think there are unlikely to be layout tests for DeviceOrientation (and other similarly mocked features) which need the real implementation, so I'm leaning towards the latter approach.

What do people think?

Once we have agreed on the approach, I'll complete the patch. Is it required to provide a complete working implementation for Mac, even though the feature is not enabled for Mac?

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