-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Fix a bug in test_driver.bless() #49719
Conversation
This code was previously doing this: let wait_click = new Promise(resolve => { button.addEventListener("click", resolve)); }; return test_driver.click(button) .then(wait_click) .then(... but the argument to `.then(wait_click)` isn't a function, it's the promise to return. Therefore .then() creates an already-resolved promise containing `wait_click` as its resolved value. Which the next `.then()` block ignores. So this wasn't actually waiting for the click to occur. This triggered a number of test bugs (caused by erroneous assumptions accidentally baked into the tests. I fixed a few, and filed a few bugs for the rest (after failing to figure out how to fix them). Note that the WPT version of testdriver.js is rolled into Chromium, so that change is being made here: #49691 Bug: 384009734,384050894 Change-Id: Ibdb8a97d23998ad89c5a48c23a7e780dc605283b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6094526 Reviewed-by: Jonathan Lee <jonathanjlee@google.com> Auto-Submit: Mason Freed <masonf@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Commit-Queue: Jonathan Lee <jonathanjlee@google.com> Cr-Commit-Position: refs/heads/main@{#1397010}
1a0b11f
to
61bf26b
Compare
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.
The review process for this patch is being conducted in the Chromium project.
@mfreed7 are the Safari test failures expected? |
Interesting. So two things changed in this PR, one is the change to |
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.
Looks good to me too.
The new failures seem like legitimate bugs, so I will merge this. |
This code was previously doing this:
let wait_click = new Promise(resolve => {
button.addEventListener("click", resolve));
};
return test_driver.click(button)
.then(wait_click)
.then(...
but the argument to
.then(wait_click)
isn't a function, it's thepromise to return. Therefore .then() creates an already-resolved
promise containing
wait_click
as its resolved value. Which the next.then()
block ignores. So this wasn't actually waiting for the clickto occur.
This triggered a number of test bugs (caused by erroneous assumptions
accidentally baked into the tests. I fixed a few, and filed a few
bugs for the rest (after failing to figure out how to fix them).
Note that the WPT version of testdriver.js is rolled into Chromium,
so that change is being made here:
#49691
Bug: 384009734,384050894
Change-Id: Ibdb8a97d23998ad89c5a48c23a7e780dc605283b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6094526
Reviewed-by: Jonathan Lee <jonathanjlee@google.com>
Auto-Submit: Mason Freed <masonf@chromium.org>
Commit-Queue: Mason Freed <masonf@chromium.org>
Commit-Queue: Jonathan Lee <jonathanjlee@google.com>
Cr-Commit-Position: refs/heads/main@{#1397010}