-
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
Tests for ResizeObserver #6878
Tests for ResizeObserver #6878
Conversation
There are no owners for this pull request. Please reach out on W3C's irc server (irc.w3.org, port 6665) on channel #testing (web client) to get help with this. Thank you! |
Build ERROREDStarted: 2017-08-14 22:19:13 View more information about this build on: |
I've looked at the travis error. It looks like a timeout.... |
Build PASSEDStarted: 2017-10-02 17:06:32 Failing Jobs
View more information about this build on: |
@atotic, have these already been reviewed once in Chromium? If so it doesn't need another full review and I can just merge this. Note that you can also just move tests to LayoutTests/external/wpt in Chromium and a PR just like this will be automatically created and merged, if that's more convenient for you. |
@atotic, one thing that you can't do from within the Chromium tree is to create OWNERS files of the correct shape. Can you add one here and add people from as many different engines as possible? |
These tests are already in the Chromium tree, and will be deleted once this pull request goes through. I will create the OWNERS file. The only person from different engines that has collaborated on these tests is mozilla's @dholbert. Is there anyone else you suggest I add? |
Nope, just add the people you know of, I don't know anything about resize observer :) |
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 have skimmed the tests and am approving this to merge once Travis is happy. I'll leave a few comments for consideration.
|
||
var onErrorCalled = false; | ||
|
||
window.onerror = err => { |
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.
err
will be bound to an event, and in any case it's not used, so _
or ()
would be more clear.
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.
will do.
guard = async_test('guard'); | ||
}, "ResizeObserver implemented") | ||
|
||
test0() |
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.
If you want the tests to be run in sequence, have you tried promise_test
? They are run one after another by default. Is it that it's pointless to run the following tests if the first does not pass?
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.
Thanks for the pointer. I was unaware that promise_tests are sequential.
My existing framework works well with RO callback pattern. It is not immediately obvious to me how to map chained RO callbacks into promise_test pattern. I'll think about it....
|
||
let guard; | ||
test(_ => { | ||
assert_own_property(window, "ResizeObserver"); |
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.
This guard is a bit curious, why is it needed? new ResizeTestHelper
will throw an exception anyway because it tried to do new ResizeOberserver
. Tests shouldn't pass if the feature isn't implemented, but the explicit guard for it is a bit unusual.
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.
Good catch. Without the guard, tests used to timeout because ResizeTestHelper would fail in constructor before async tests were created. I can fix this.
Also includes new OWNERS file.
ResizeObserver is a new DOM API that we are planning to ship in Chrome.
https://github.com/WICG/ResizeObserver
Chrome tracking bug at: https://crbug.com/612962
These tests will help other platforms implement a spec-compliant, inter operable API.
An intern at Firefox has worked on implementing it last year, and we shared these tests.