Robbie McElrath would like Reilly Grant to review this change.
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
---
M third_party/WebKit/LayoutTests/device_orientation/orientation/basic-operation.html
M third_party/WebKit/LayoutTests/device_orientation/resources/device-orientation-helpers.js
M third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js
3 files changed, 57 insertions(+), 7 deletions(-)
To view, visit change 1073918. To unsubscribe, or for help writing mail filters, visit settings.
This change is ready for review.
1 comment:
File third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js:
Patch Set #1, Line 433: let errorMessage = 'Timeout waiting for expected event: ';
It would be nice to print the expected event here. It is possible to construct instances of DeviceOrientationEvent and DeviceMotionEvent with arbitrary contents so passing the actual expected event object might be a better API than taking an eventType and checker.
To view, visit change 1073918. To unsubscribe, or for help writing mail filters, visit settings.
1 comment:
File third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js:
Patch Set #1, Line 433: timeoutId = targetWindow.setTimeout(() => {
It would be nice to print the expected event here. […]
Done
To view, visit change 1073918. To unsubscribe, or for help writing mail filters, visit settings.
LGTM
Patch set 2:Code-Review +1
Patch set 2:Commit-Queue +2
Commit Bot merged this change.
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 <rei...@chromium.org>
Commit-Queue: Robbie McElrath <rmce...@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562089}
---
M third_party/WebKit/LayoutTests/device_orientation/orientation/basic-operation.html
M third_party/WebKit/LayoutTests/device_orientation/resources/device-orientation-helpers.js
M third_party/WebKit/LayoutTests/http/tests/resources/sensor-helpers.js
3 files changed, 60 insertions(+), 7 deletions(-)