-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable WPT tests for the Generic Sensor classes #10198
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already reviewed downstream.
Build PASSEDStarted: 2018-04-04 09:23:25 View more information about this build on: |
@pozdnyakov, thank you for bring this to advance test automation for Generic Sensor. And if we use Test API, we should definitely defined a Test API spec for both test contributor and future implementations. Just like what WebUSB had done at https://wicg.github.io/webusb/test/ |
}; | ||
}, name, properties); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd better to wrap above codes into a separated JS file specific for different implementation backends, and defined common util functions for generic-sensor-tests.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll put it into a separate '.. -helper.js' file in the next patch at https://chromium-review.googlesource.com/c/chromium/src/+/980886
@@ -120,7 +169,7 @@ function runGenericSensorTests(sensorType) { | |||
sensor.stop(); | |||
}, `${sensorType.name}: sensor.start() returns undefined`); | |||
|
|||
promise_test(async t => { | |||
sensor_test(async t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually many tests can be automated without Test API. We should only replace those tests really need Test API for automation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, so I've modified only those test cases that need actual sensor backend working
|
||
test(() => { | ||
const invalidFreqs = [ | ||
"invalid", | ||
NaN, | ||
Infinity, | ||
-Infinity, | ||
{}, | ||
undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove the undefined
value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, unlike the following test case for referenceFrame
, the frequency
field does not have a default value, so undefined
should be returned here. Thanks for the catch!
}; | ||
}, name, properties); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll put it into a separate '.. -helper.js' file in the next patch at https://chromium-review.googlesource.com/c/chromium/src/+/980886
@@ -120,7 +169,7 @@ function runGenericSensorTests(sensorType) { | |||
sensor.stop(); | |||
}, `${sensorType.name}: sensor.start() returns undefined`); | |||
|
|||
promise_test(async t => { | |||
sensor_test(async t => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, so I've modified only those test cases that need actual sensor backend working
|
||
test(() => { | ||
const invalidFreqs = [ | ||
"invalid", | ||
NaN, | ||
Infinity, | ||
-Infinity, | ||
{}, | ||
undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, unlike the following test case for referenceFrame
, the frequency
field does not have a default value, so undefined
should be returned here. Thanks for the catch!
@@ -300,8 +350,7 @@ function runGenericSensorTests(sensorType) { | |||
123, | |||
{}, | |||
"", | |||
true, | |||
undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here undefined
is valid input as referenceFrame
has a default value (based on https://heycam.github.io/webidl/#es-dictionary)
@Honry thanks for your comments! Could we proceed the review process in https://chromium-review.googlesource.com/c/chromium/src/+/980886, so that we have all the comments consolidated in a single place.
For the Generic Sensor implementation in Chromium we want to test the whole bindings code in the dedicated module, this could be achieved only with mocking the involved mojo interfaces. Not sure WebDriver can do this.
So far it's only |
96a2463
to
e91bf37
Compare
@pozdnyakov, sorry for the inconvenient, I will review in chromium for your next patch.
So, will you bring more methods to WPT? |
e91bf37
to
76f965e
Compare
a6e81dd
to
f54b0fc
Compare
f54b0fc
to
b7b2b7e
Compare
@pozdnyakov, Travis is failing because when running these tests against Chrome Dev, the results were unstable. From https://travis-ci.org/w3c/web-platform-tests/jobs/366060782, can you tell why that is the case instead of them all failing consistently due to the lack of mojo mocking? We shouldn't change this PR unless we really have to, if there's some fix needed then a separate Chromium CL that we export roughly at the same time is better. @jgraham FYI that this introduces something that's special for Chrome and will only work with extra command line arguments, the same as for Bluetooth and USB: Because this doesn't expose any new API surface but just makes it seem like sensors exist it's not very hard to see a WebDriver path forward for this, and #9686 is the tracking issue. |
I ran these tests locally, got the same error, Error appears upon starting the browser that “you are using an unsupported command line flag: --enable-blink-features=MojoJS,MojoTest. Stability and security will suffer” |
@Honry how about if you pass the flags as documented in http://web-platform-tests.org/running-tests/chrome.html? |
Yeah, it works, but another consistent error: Moreover, @pozdnyakov, tests under following folders should be updated as well, because they are using the same framework:
|
Ah, |
@foolip, yes, But there coming with another consistent error :-/
While which can be pass in Chromium Layout testing (test path: LayoutTests/external/wpt/), @pozdnyakov, could you pls. take a look? |
That's probably because of web-platform-tests/results-collection#81, right? |
No, I've already passed the Mojo flags, |
Oh. Well then I have no idea, hopefully @pozdnyakov does :) |
Looking.. Sorry for the delay |
@pozdnyakov any luck? Should we merge this and look into the fix separately, or what's the most effective way to resolve this? |
Just to see if the flakiness has gone away, as in #10497, I'll rebase this to trigger another Travis run. |
b7b2b7e
to
56e189a
Compare
restarts travis |
@foolip sorry for the late notice. I'm not working on the project starting from this month. Unfortunately I was not able to fix the flakiness before I left. I think someone from my team can proceed with this. @alexshalamov could you PTAL? |
@alexshalamov will you be able to look at this? Note that after about a month the Chromium-side CL will fall outside of the window of considered commits and the change will be implicitly reverted by import. And... it turns out this happened 5 days ago: That's really unfortunate, because these were good changes. I think the cleanest thing to recover is to just merge this now. @Hexcles, do you know how we could notice when this is approaching to raise the urgency of a blocked export when it gets close? |
56e189a
to
350abc0
Compare
I've rebased the branch (chromium-export-cl-980886) on master. When Travis has finished running, if the only Travis failures are in the Chrome stability job, I will merge this PR and file a bug to track the flakiness. |
350abc0
to
c0488d9
Compare
This patch introduces mock implementations of the Sensor and SensorProvider mojo interfaces to the WPT tests for Chromium. The ongoing WPT issue for the Generic Sensor tests automation: #9686 Bug: 816462 Change-Id: I8e4880ee5269b07f0bf68a2752038e128d166c55 Reviewed-on: https://chromium-review.googlesource.com/980886 Reviewed-by: Mike West <[email protected]> Reviewed-by: Philip Jägenstedt <[email protected]> Reviewed-by: Reilly Grant <[email protected]> Reviewed-by: Alexander Shalamov <[email protected]> Commit-Queue: Mikhail Pozdnyakov <[email protected]> Cr-Commit-Position: refs/heads/master@{#550586}
c0488d9
to
395be6a
Compare
Merged with this failure: It's possible and even likely that some of these tests will now be flaky in Chrome Dev, so I'll file another issue for that. |
@foolip thanks for putting out the fire. The window used to be around a month, and only few un-merged exports have been overwritten by imports so far. Yet apparently the window can bu much shorter in reality (see https://crbug.com/752214), and when overwriting does happen, things can be messy and confusing. I'll increase the history window for now to give us a longer window to handle unmerged exports for now, and think about a long-term solution for this "ultimate" failure mode of the exporter. |
- `if (testRunner)` should be `if (window.testRunner)` - Use String to pass sensor object param to avoid undefined error
This patch introduces mock implementations of the Sensor
and SensorProvider mojo interfaces to the WPT tests
for Chromium.
The ongoing WPT issue for the Generic Sensor tests automation:
#9686
Bug: 816462
Change-Id: I8e4880ee5269b07f0bf68a2752038e128d166c55
Reviewed-on: https://chromium-review.googlesource.com/980886
Reviewed-by: Mike West [email protected]
Reviewed-by: Philip Jägenstedt [email protected]
Reviewed-by: Reilly Grant [email protected]
Reviewed-by: Alexander Shalamov [email protected]
Commit-Queue: Mikhail Pozdnyakov [email protected]
Cr-Commit-Position: refs/heads/master@{#550586}
This change is