-
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
Add null-check to aria_utils verifyLabelsBySelector #44361
Conversation
Before this commit, verifyLabelsBySelector calls test_driver.get_computed_label and then does string-manipulation on the result. For some reason, this get_computed_label invocation returns null in Firefox, and so the string-manipulation causes a JS exception to be thrown, which makes for awkward test failure results. Let's just explicitly assert that the result is not-null, to make that expectation clearer and to give a cleaner test-failure in cases where it is unexpectedly null.
For reference, I noticed this coming in to play on this WPT in particular: Before this PR, Firefox has some failures there that look like this:
After this PR, that failure looks like this instead:
(I'm including |
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.
Approving with one formatting nit diff. Thanks.
Co-authored-by: James Craig <[email protected]>
…ts#44361) * Add null-check to aria_utils verifyLabelsBySelector Before this commit, verifyLabelsBySelector calls test_driver.get_computed_label and then does string-manipulation on the result. For some reason, this get_computed_label invocation returns null in Firefox, and so the string-manipulation causes a JS exception to be thrown, which makes for awkward test failure results. Let's just explicitly assert that the result is not-null, to make that expectation clearer and to give a cleaner test-failure in cases where it is unexpectedly null.
* Add null-check to aria_utils verifyLabelsBySelector Before this commit, verifyLabelsBySelector calls test_driver.get_computed_label and then does string-manipulation on the result. For some reason, this get_computed_label invocation returns null in Firefox, and so the string-manipulation causes a JS exception to be thrown, which makes for awkward test failure results. Let's just explicitly assert that the result is not-null, to make that expectation clearer and to give a cleaner test-failure in cases where it is unexpectedly null.
Before this commit, verifyLabelsBySelector calls test_driver.get_computed_label and then does string-manipulation on the result. For some reason, this get_computed_label invocation returns null in Firefox, and so the string-manipulation causes a JS exception to be thrown, which makes for awkward test failure results.
Let's just explicitly assert that the result is not-null, to make that expectation clearer and to give a cleaner test-failure in cases where it is unexpectedly null.