Repository navigation
[idlharness.js] Add inheritor as dep for includes - #12165
Conversation
|
There were several 'regressions' caused by this change; all of them are useful (they highlight incorrect test setup). I've patched in a fix for the fixable ones (correct imports). |
|
webxr/ LGTM, though I admittedly don't fully understand how this works. If there are fixes needed for other tests, I think this would need more guidance how to go about fixing them. |
birtles
left a comment
There was a problem hiding this comment.
r=me for the css-transitions / css-animations part with the one change to the transition event name made.
| ['cssom', 'html', 'dom'], | ||
| idl_array => { | ||
| idl_array.add_objects({ | ||
| TransitionEvent: ['new TransitionEvent("transition")'], |
There was a problem hiding this comment.
It might be better to use an actual event name here instead of transition, e.g. transitionend (the most widely supported transition event)
There was a problem hiding this comment.
Something like "x" or "type" is also good in that it's clearer that the string doesn't matter. (I've seen some case where multiple instances that differ only by the event type have been tested, which won't do any good.)
foolip
left a comment
There was a problem hiding this comment.
LGTM with thoughts and pushed two tweak commits
| Request: ["new Request('about:blank')"], | ||
| Response: ["new Response()"], | ||
| }); | ||
| if (self.GLOBAL.isWindow()) { |
There was a problem hiding this comment.
Would { WindowOrWorkerGlobalScope: ['self'] } work, or isn't idlharness.js clever enough to connect the dots between that and what needs to be tested?
There was a problem hiding this comment.
In some cases, because it's only testing a partial, that works fine. However, it's not how you're supposed to structure the tests:
The interface has to be the primary interface of all the objects provided. For example, don’t pass {Node: ["document"]}, but rather {Document: ["document"]}. Assuming the Document interface was declared to inherit from Node, this will automatically test that document implements the Node interface too.
There was a problem hiding this comment.
Oh, does that mean that the GlobalEventHandlers bit in
wpt/selection/idlharness.window.js
Line 16 in 13a85a4
{ WindowOrWorkerGlobalScope: ['self'] }.
There was a problem hiding this comment.
Yes, that's wrong, but it was written prior to this fix, so was a reasonable way of forcing coverage of GlobalEventHandlers at the time. Like I said; if it's only testing a partial, it doesn't fail anything, but if there's any methods that it's testing on the concrete class (e.g. toJSON) it's a problem.
There was a problem hiding this comment.
I don't understand the details of how this is implemented, but it looks like with the changes in this PR, if I just delete GlobalEventHandlers: ['self'] from selection/idlharness.window.js, two legitimately failing tests disappear, even though Window: ['window'] is still there. I'll leave it to you to file a bug or add a TODO if there is still a problem here.
There was a problem hiding this comment.
Ah; I see your confusion, but essentially you're seeing 2 duplicated failing tests, which are already covered by window (a.k.a. self)
Fail | Window interface: window must inherit property "onselectstart" with the proper type
Fail | Window interface: window must inherit property "onselectionchange" with the proper type
Adding self causes the same 2 tests to be executed on the self object, which is in fact the same as if we added self to the array of Window objects, i.e.
Fail | Window interface: self must inherit property "onselectionchange" with the proper type
There was a problem hiding this comment.
Oh, I even searched for and found those tests, but thought that probably they're incorrectly resting that the Window interface object has these attributes. The lower-case "window" means it ain't so. Cool, I'll send a PR to remove that line then.
There was a problem hiding this comment.
Oh you already removed it, thanks!
| ['webxr'], | ||
| ['html', 'dom'], | ||
| idl_array => { | ||
| idl_array.add_untested_idls("dictionary WebGLContextAttributes {};"); |
There was a problem hiding this comment.
Is something tracking importing webgl1.idl and webgl2.idl from https://github.com/tidoust/reffy-reports/tree/master/whatwg/idl?
There was a problem hiding this comment.
Not as yet; they're in the TODO list
https://github.com/web-platform-tests/wpt/projects/1?card_filter_query=webgl
| name && skipped.has(name) | ||
| ? skipped.get(name).push(parsed) | ||
| : skipped.set(name, [parsed]); | ||
| (name.includes('Global') || name.includes('Window')) && console.log("Skipped", parsed); |
There was a problem hiding this comment.
Can you drop the console.log? It would cause changes to lots of -expected.txt files in Chromium.
There was a problem hiding this comment.
Yep - Left in by mistake (this PR was kinda hard to get right ;) )
| const follow_up = new Set(); | ||
| for (const dep_type of ["inheritance", "implements", "includes"]) { | ||
| if (parsed[dep_type]) { | ||
| const inheriting = parsed[dep_type]; |
There was a problem hiding this comment.
It's a bit hard to tell in the GitHub UI, but for other reviewers, here are the interesting changes. (git diff -w tells me so)
|
Travis failure is because of #12174 |
This addresses an issue where, when testing a partial interface, we are not including the parents that implement said interface as dependencies.
Specific example:
In
pointerevents, we havepartial interface GlobalEventHandlersWindow includes GlobalEventHandlers, but we do not includeWindowas an untested dep, so none of the members added in the partial are tested.To fix this, we treat both sides of
A includes Bas being deps.I tested this in combination with #11922 locally, and the result was 129 tests (nearly double status quo).