Use Mojo JS mock in LayoutTests/device_orientation/resources/device-orientation-helpers.js |
|||||
Issue descriptionThis issue tracks the progress of JS layout test support for shared buffers, and when it is ready, the layout tests can be converted to use that for mocking. More context: it is from the TODO in the following CL: https://codereview.chromium.org/2037513002/diff/520001/content/renderer/device_sensors/device_sensor_event_pump.h
,
Oct 25 2017
,
Nov 8 2017
The layout tests for sensors are already using shared buffer, and the JS mocks for the backends (pls see https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js) Is there anything missing?
,
Nov 8 2017
hmm... I think this issue is for updating some test code related to device motion and orientation event, not the generic sensor.
,
Feb 26 2018
I agree, shared buffer support appears to be ready. Repurposing this bug to track rewriting LayoutTests/device_orientation/resources/device-orientation-helpers.js to use the Generic Sensor mocking infrastructure so we can remove the testRunner methods for setting fake sensor data.
,
May 10 2018
,
May 17 2018
,
May 25 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268 commit fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268 Author: Robbie McElrath <rmcelrath@chromium.org> Date: Fri May 25 18:48:50 2018 Make sensor event pump classes use mojom service in layout tests. This is needed to migrate sensor layout tests to using mock mojom services instead of testRunner.setMockDevice[Motion|Orientation]. Currently the event pump classes don't bind to a mojom service if they're running as part of a layout test, but they'll need to in order to use a mock mojom service to provide the testing data. This will make existing layout tests try to connect to the generic sensor provider mojom service, which could break the existing tests if the null-event is fired when the service isn't found. This isn't actually an issue with the existing layout tests because of the way the sensor event pump classes handle missing mojom services. DeviceSensorEventPump::HandleSensorProviderError is called when the SensorProvider service can't be found, which resets the mojom pipe without calling OnSensorCreated, which would lead to the null-event being fired. Eventually we should fix the sensor event pump classes to send the null-event when the sensor provider mojom service isn't found, but for now the fact that we don't allows us to migrate the sensor layout tests piecemeal, which is good. There are two tests that this affects. One of them is a wpt test that we currently timeout on, but now fails. I'll fix that in a followup CL. The other test this breaks is testing behavior that goes against the spec, so I updated that test to actually test what it says it's testing, and to match the spec. Bug: 774183 , 802815 Change-Id: I376d94a7e7f35aefdb4b586050a03e198988e8be Reviewed-on: https://chromium-review.googlesource.com/1060380 Reviewed-by: Tim Volodine <timvolodine@chromium.org> Reviewed-by: Jun Cai <juncai@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Commit-Queue: Robbie McElrath <rmcelrath@chromium.org> Cr-Commit-Position: refs/heads/master@{#561959} [modify] https://crrev.com/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268/content/renderer/device_sensors/device_motion_event_pump.cc [modify] https://crrev.com/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268/content/renderer/device_sensors/device_motion_event_pump.h [modify] https://crrev.com/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268/content/renderer/device_sensors/device_motion_event_pump_unittest.cc [modify] https://crrev.com/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268/content/renderer/device_sensors/device_orientation_event_pump.cc [modify] https://crrev.com/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268/content/renderer/device_sensors/device_orientation_event_pump.h [modify] https://crrev.com/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268/content/renderer/device_sensors/device_orientation_event_pump_unittest.cc [modify] https://crrev.com/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/fb44d3a0e6db2c18c4cb6d5f2fb1550ee9b8e268/third_party/WebKit/LayoutTests/device_orientation/motion/add-during-dispatch.html
,
May 25 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/8bc33b3f35e74d698d49bb31934f6d409b7cf84d commit 8bc33b3f35e74d698d49bb31934f6d409b7cf84d Author: Robbie McElrath <rmcelrath@chromium.org> Date: Fri May 25 19:58:09 2018 Make deviceorientationabsoluteevent WPT test match spec The deviceorientationabsoluteevent WPT test currently asserts that the 'absolute' property of the deviceorientationabsolute event is false. The spec states that: https://w3c.github.io/deviceorientation/spec-source-orientation.html#deviceorientationabsolute "The deviceorientationabsolute event is completely analogous to the deviceorientation event, except additional sensors like the magnetometer can be used to provide an absolute orientation. The absolute property must be set to true." This updates the test to assert that absolute is set to true. Bug: 774183 , 802815 Change-Id: I3694e2b774aa0e4a8a9f7d0328e2aad8b37775e6 Reviewed-on: https://chromium-review.googlesource.com/1062650 Commit-Queue: Robbie McElrath <rmcelrath@chromium.org> Reviewed-by: Jun Cai <juncai@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Cr-Commit-Position: refs/heads/master@{#561984} [modify] https://crrev.com/8bc33b3f35e74d698d49bb31934f6d409b7cf84d/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/8bc33b3f35e74d698d49bb31934f6d409b7cf84d/third_party/WebKit/LayoutTests/external/wpt/orientation-event/deviceorientationabsoluteevent.html |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dtapu...@chromium.org
, Oct 20 2017