-
Notifications
You must be signed in to change notification settings - Fork 70
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
RFC 207: step_wait_promise
method
#207
base: master
Are you sure you want to change the base?
RFC 207: step_wait_promise
method
#207
Conversation
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 <[email protected]>
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, this should work. Thanks!
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But perhaps this can be fixed in the step_wait_func
method instead.
Preview