New issue
Advanced search Search tips

Issue 802815 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 3
Type: Feature



Sign in to add a comment

Remove test bindings for sending fake device motion/orientation events

Project Member Reported by reillyg@chromium.org, Jan 16 2018

Issue description

Now that device motion/orientation events are backed by the same Mojo service as the Generic Sensors API the testRunner.setMockDeviceMotion and testRunner.setMockDeviceOrientation functions can be removed and third_party/WebKit/LayoutTests/sensor/resources/sensor-helpers.js used instead.
 
Cc: hajimehoshi@chromium.org altimin@chromium.org
Components: Blink>Sensor
Status: Available (was: Untriaged)

Comment 4 by juncai@chromium.org, Mar 21 2018

Cc: -juncai@chromium.org
Owner: juncai@chromium.org
Status: Assigned (was: Available)
Cc: juncai@chromium.org reillyg@chromium.org
Owner: ----
Status: Available (was: Assigned)
rmcelrath@chromium.org, when that account exists, will be working on this.
Owner: rmcelrath@chromium.org
Project Member

Comment 7 by bugdroid1@chromium.org, May 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/433faf46f27d0fbd53eb1a613a621cf6cdade2a2

commit 433faf46f27d0fbd53eb1a613a621cf6cdade2a2
Author: Robbie McElrath <rmcelrath@chromium.org>
Date: Tue May 15 20:22:29 2018

Move sensor-helpers.js to http/tests/resources

This file will be used by layout tests in http/, so it needs to be visible to them. I was told to
move the file to http/tests/resources, but it looks like another option would be to expose
sensor/resources to http tests via the apache_http.py script, which might be cleaner. Thoughts?

Bug:  802815 
Change-Id: I3a8e37e0d41915d8cd5c5983d50d0f4dcc69ebcb
Reviewed-on: https://chromium-review.googlesource.com/1058549
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558823}
[rename] https://crrev.com/433faf46f27d0fbd53eb1a613a621cf6cdade2a2/third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js
[modify] https://crrev.com/433faf46f27d0fbd53eb1a613a621cf6cdade2a2/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/433faf46f27d0fbd53eb1a613a621cf6cdade2a2/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/433faf46f27d0fbd53eb1a613a621cf6cdade2a2/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[modify] https://crrev.com/433faf46f27d0fbd53eb1a613a621cf6cdade2a2/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/433faf46f27d0fbd53eb1a613a621cf6cdade2a2/third_party/WebKit/LayoutTests/sensor/mock-sensor.html
[modify] https://crrev.com/433faf46f27d0fbd53eb1a613a621cf6cdade2a2/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html

Project Member

Comment 8 by bugdroid1@chromium.org, May 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/257f1cd18f91e65789da7db058e86825ffe80516

commit 257f1cd18f91e65789da7db058e86825ffe80516
Author: Robbie McElrath <rmcelrath@chromium.org>
Date: Wed May 16 17:54:53 2018

Make MockSensorProvider support mocking multiple sensor types at the same time

This is needed in order to migrate the devicemotion layout tests over to
using mock generic sensor services. The old devicemotion events are backed
by 3 different generic sensor types, so the MockSensorProvider needs to be
able to mock and allow tests to get references to multiple types of
sensors at the same time in order for these tests to mock out everything
they use.

Bug:  802815 
Change-Id: I254c37d67db0e9c6feb639080394305b41f6b7e6
Reviewed-on: https://chromium-review.googlesource.com/1060477
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559176}
[modify] https://crrev.com/257f1cd18f91e65789da7db058e86825ffe80516/third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js
[modify] https://crrev.com/257f1cd18f91e65789da7db058e86825ffe80516/third_party/WebKit/LayoutTests/sensor/accelerometer.html
[modify] https://crrev.com/257f1cd18f91e65789da7db058e86825ffe80516/third_party/WebKit/LayoutTests/sensor/ambient-light-sensor.html
[modify] https://crrev.com/257f1cd18f91e65789da7db058e86825ffe80516/third_party/WebKit/LayoutTests/sensor/gyroscope.html
[modify] https://crrev.com/257f1cd18f91e65789da7db058e86825ffe80516/third_party/WebKit/LayoutTests/sensor/magnetometer.html
[modify] https://crrev.com/257f1cd18f91e65789da7db058e86825ffe80516/third_party/WebKit/LayoutTests/sensor/orientation-sensor.html
[modify] https://crrev.com/257f1cd18f91e65789da7db058e86825ffe80516/third_party/WebKit/LayoutTests/sensor/resources/generic-sensor-tests.js

Cc: sa...@chromium.org rmcelrath@chromium.org
 Issue 774183  has been merged into this issue.
Project Member

Comment 10 by bugdroid1@chromium.org, 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

Project Member

Comment 11 by bugdroid1@chromium.org, May 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7c2b0f2013fe2567e9829d4f1525cfadb3f0e36c

commit 7c2b0f2013fe2567e9829d4f1525cfadb3f0e36c
Author: Robbie McElrath <rmcelrath@chromium.org>
Date: Fri May 25 19:57:28 2018

Migrate one deviceorientation test to use mojom mocks

The rest of the tests will be migrated in upcoming CLs. This only does
one test to get feedback on the overall approach.

Bug:  802815 
Change-Id: Icce6ac6a1055b699daca5a7e4c091d3e33754885
Reviewed-on: https://chromium-review.googlesource.com/1062777
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561983}
[modify] https://crrev.com/7c2b0f2013fe2567e9829d4f1525cfadb3f0e36c/third_party/WebKit/LayoutTests/device_orientation/orientation/basic-operation.html
[modify] https://crrev.com/7c2b0f2013fe2567e9829d4f1525cfadb3f0e36c/third_party/WebKit/LayoutTests/device_orientation/resources/device-orientation-helpers.js
[modify] https://crrev.com/7c2b0f2013fe2567e9829d4f1525cfadb3f0e36c/third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js

Project Member

Comment 12 by bugdroid1@chromium.org, 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

Project Member

Comment 13 by bugdroid1@chromium.org, May 26 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8a69823f09bb2514f5109d5d883717d00967099b

commit 8a69823f09bb2514f5109d5d883717d00967099b
Author: Robbie McElrath <rmcelrath@chromium.org>
Date: Sat May 26 00:56:57 2018

Refactor sensor layout test helper code

Now that we're using mojo mocks for device sensor data in tests, it's
possible that the first event fired after setting new fake data won't
contain the new data yet. This isn't a bug, it's just a result of the
fact that the actual sensor code path, which we're now exercising, isn't
synchronous like the old approach was. This updates the sensor test
helpers to be more robust and handle delays in the fake data getting
through the system.

Bug:  802815 
Change-Id: I32ca80369225700c13ef37b7d23f59777ab69a38
Reviewed-on: https://chromium-review.googlesource.com/1073918
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562089}
[modify] https://crrev.com/8a69823f09bb2514f5109d5d883717d00967099b/third_party/WebKit/LayoutTests/device_orientation/orientation/basic-operation.html
[modify] https://crrev.com/8a69823f09bb2514f5109d5d883717d00967099b/third_party/WebKit/LayoutTests/device_orientation/resources/device-orientation-helpers.js
[modify] https://crrev.com/8a69823f09bb2514f5109d5d883717d00967099b/third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js

Project Member

Comment 14 by bugdroid1@chromium.org, May 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d

commit a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d
Author: Robbie McElrath <rmcelrath@chromium.org>
Date: Tue May 29 21:29:33 2018

Migrate devicemotion layout tests to use mojo mocks

This migrates all the layout tests in device_orientation/motion to use
fake mojo services instead of testRunner.setMockDeviceMotion.

Bug:  802815 
Change-Id: I2175bd9f463b4a9e0fc69fa83af3d2ff8fb821e2
Reviewed-on: https://chromium-review.googlesource.com/1073920
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562595}
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/device_orientation/motion/add-during-dispatch.html
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/device_orientation/motion/add-listener-from-callback.html
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/device_orientation/motion/detached-frame.html
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/device_orientation/motion/fire-last-event.html
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/device_orientation/motion/multiple-event-listeners.html
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/device_orientation/motion/null-values.html
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/device_orientation/motion/page-visibility.html
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/device_orientation/resources/device-orientation-helpers.js
[modify] https://crrev.com/a80c38dfc0ea8d81e2b3bddaf1415b203f2b743d/third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js

Project Member

Comment 16 by bugdroid1@chromium.org, May 29 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/843eb85abecac369c3a675749055a0c0b6607522

commit 843eb85abecac369c3a675749055a0c0b6607522
Author: Robbie McElrath <rmcelrath@chromium.org>
Date: Tue May 29 21:45:00 2018

Migrate devtools deviceorientation layout test to use mojo mocks.

Bug:  802815 
Change-Id: Ib69ad4d375648cdd8026b457f274c9a54894c54f
Reviewed-on: https://chromium-review.googlesource.com/1075860
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562604}
[modify] https://crrev.com/843eb85abecac369c3a675749055a0c0b6607522/third_party/WebKit/LayoutTests/http/tests/devtools/device-orientation-success-expected.txt
[modify] https://crrev.com/843eb85abecac369c3a675749055a0c0b6607522/third_party/WebKit/LayoutTests/http/tests/devtools/device-orientation-success.js

Project Member

Comment 17 by bugdroid1@chromium.org, Jun 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/eebffe1ae2653744049400c7a13c28f194e48457

commit eebffe1ae2653744049400c7a13c28f194e48457
Author: Robbie McElrath <rmcelrath@chromium.org>
Date: Fri Jun 01 03:18:32 2018

Migrate deviceorientation layout tests to use mojo mocks


Bug:  802815 
Change-Id: Id0d67914e7a1b940ba1cd72644419c9dcd3cbb9a
Reviewed-on: https://chromium-review.googlesource.com/1077097
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: Tim Volodine <timvolodine@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563517}
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/content/renderer/device_sensors/device_orientation_event_pump.cc
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/third_party/WebKit/LayoutTests/device_orientation/orientation/add-listener-from-callback.html
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/third_party/WebKit/LayoutTests/device_orientation/orientation/basic-operation-absolute.html
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/third_party/WebKit/LayoutTests/device_orientation/orientation/multiple-event-listeners.html
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/third_party/WebKit/LayoutTests/device_orientation/orientation/multiple-frames.html
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/third_party/WebKit/LayoutTests/device_orientation/orientation/no-synchronous-events.html
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/third_party/WebKit/LayoutTests/device_orientation/orientation/null-values.html
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/third_party/WebKit/LayoutTests/device_orientation/orientation/page-visibility.html
[modify] https://crrev.com/eebffe1ae2653744049400c7a13c28f194e48457/third_party/WebKit/LayoutTests/device_orientation/orientation/updates.html

Project Member

Comment 18 by bugdroid1@chromium.org, Jun 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/aa0a2ea752062cca4c608bf5753e46baaf786ee4

commit aa0a2ea752062cca4c608bf5753e46baaf786ee4
Author: Robbie McElrath <rmcelrath@chromium.org>
Date: Mon Jun 04 19:54:20 2018

Delete TestRunner::setMockDeviceMotion/Orientation and downstream code.

Bug:  802815 
Change-Id: I0fe2d7baf5a81edc065de21f2f9e8cba7c4df010
Reviewed-on: https://chromium-review.googlesource.com/1077013
Commit-Queue: Robbie McElrath <rmcelrath@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Tim Volodine <timvolodine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564195}
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/public/renderer/platform_event_observer.h
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/public/test/layouttest_support.h
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/renderer/device_sensors/device_motion_event_pump.cc
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/renderer/device_sensors/device_motion_event_pump.h
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/renderer/device_sensors/device_orientation_event_pump.cc
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/renderer/device_sensors/device_orientation_event_pump.h
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/renderer/renderer_blink_platform_impl.cc
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/renderer/renderer_blink_platform_impl.h
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/shell/renderer/layout_test/blink_test_runner.cc
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/shell/renderer/layout_test/blink_test_runner.h
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/shell/test_runner/test_runner.cc
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/shell/test_runner/test_runner.h
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/shell/test_runner/web_test_delegate.h
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/content/test/layouttest_support.cc
[modify] https://crrev.com/aa0a2ea752062cca4c608bf5753e46baaf786ee4/third_party/WebKit/LayoutTests/device_orientation/resources/device-orientation-helpers.js

Status: Fixed (was: Available)

Sign in to add a comment