-
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
[idlharness] Test class string of prototype objects #27239
base: master
Are you sure you want to change the base?
[idlharness] Test class string of prototype objects #27239
Conversation
Will this introduce new failures to lots of tests that previously had no failing subtests? |
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 like this breaks some unit tests:
E - {u'message': u'assert_class_string: class string of Window.prototype expected "[object Window]" but got "[object WindowProperties]"',
E + {u'message': None,
E u'name': u'Window interface: existence and properties of interface prototype object',
E u'properties': {},
E - u'status_string': u'FAIL'},
E ? ^ ^^
E + u'status_string': u'PASS'},
E ? ^ ^^
Good question. Possibly it will cause all idlharness tests to fail in Firefox; I don't know how many are fully green at this point. |
@Ms2ger Also, that |
The unit tests need fixing. Looks like CI runs them as
|
I have filed https://bugzilla.mozilla.org/show_bug.cgi?id=1688198 to get this fixed in Firefox. |
@ExE-Boss do you intend to block this on https://bugzilla.mozilla.org/show_bug.cgi?id=1688198? Digging into the Chrome regression in https://github.com/web-platform-tests/wpt/pull/27239/checks?check_run_id=1784377402 would be good, but it looks like no changes in Safari test results, which is good. |
6426438
to
c51fd10
Compare
Looks like Chrome has a bug in their implementation of RTCEncodedVideoFrame and RTCEncodedAudioFrame in that they don’t define a I’d also prefer to get this merged sooner rather than later. |
c51fd10
to
49b53d3
Compare
@ExE-Boss there have been a lot of changes around idlharness.js recently, so I rebased this to see what the current state looks like. |
Safari results look good, the only difference is in a test that I know is flaky: |
// assert_class_string(this.get_interface_object().prototype, this.get_qualified_name() + "Prototype", | ||
// "class string of " + this.name + ".prototype"); | ||
assert_class_string(this.get_interface_object().prototype, this.get_qualified_name(), | ||
"class string of " + this.name + ".prototype"); | ||
|
||
// String() should end up calling {}.toString if nothing defines a | ||
// stringifier. | ||
if (!this.has_stringifier()) { |
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 the above check of a Symbol.toStringTag
own property is done, then I think this whole bit can just be removed. The presence of a Symbol.toStringTag
doesn't depend on whether there's a stringifier, and can be tested even in the presence of a stringifier. We don't need to also test that String()
is implemented correctly, at least not for the prototype object.
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.
Testing @@toStringTag is great, but I think we should also make sure to test something closer to how it is used in practice, such as String()
.
resources/test/tests/functional/idlharness/IdlInterface/test_immutable_prototype.html
Outdated
Show resolved
Hide resolved
I tested this a bit. Rather, it's calling This is a bug in Chrome, but the way it should be detected is by checking for the absence of "toString" if there's no stringifier. But if the final shape of this PR still has a test failing for this reason and it's kind of obscure why, that's OK, I'll file a bug about it then.
Sorry 😳 |
Co-authored-by: Philip Jägenstedt <philip@foolip.org>
49b53d3
to
657ec7a
Compare
This has been specified in whatwg/webidl#357.
See also: #23206