RFC 207: step_wait_promise method#207
RFC 207: step_wait_promise method#207sadym-chromium wants to merge 6 commits intoweb-platform-tests:mainfrom
step_wait_promise method#207Conversation
step_wait_promise methodstep_wait_promise method
|
What happens if the promise rejects? |
The step will fail with the rejection reason |
|
Please clarify in the rfc |
Right, I missed it. Done. |
Co-authored-by: Sam Sneddon <me@gsnedders.com>
|
I assume the RFC is accepted. @past could you please merge? |
|
I will give this another week, given that it was filed after our last WPT infra meeting, since many people are still out of office. I see no objections and one approval, so I expect it will be swiftly approved. I will bring it up in our meeting next Tuesday. |
|
|
||
| ## Details | ||
|
|
||
| * **`step_wait_promise(promise, description, timeout=default_timeout)`** |
There was a problem hiding this comment.
Do we want to add a Test.step_wait_promise_done as well?
Test.step_wait already optionally takes a Promise as its first argument, so is this basically just:
Test.prototype.step_wait_promise(promise, description, timeout) {
return this.step_wait_func(() => promise, description, timeout)
}
There was a problem hiding this comment.
indeed, this should work. Thanks!
There was a problem hiding this comment.
Oh, wait. The step_wait_func does not respect the timeout of the cond:
var wait_for_inner = test_this.step_func(() => {
Promise.resolve(cond()).then( // `step_wait_func` waits for the `cond` disregarding `timeout` argument.
step, // Timeout is checked here
test_this.unreached_func("step_wait_func"));
});There was a problem hiding this comment.
But perhaps this can be fixed in the step_wait_func method instead.
Preview