-
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
HTML: Fix test when run through ./wpt run #12885
Conversation
When run through ./wpt run, the test window is created by another window through window.open(), so opener is not null in the main page (when we expect it to be null).
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, ./wpt run
does open new windows and this fix looks correct.
@foolip it's worrying to me that test authors have to be aware of this. Is there anything we could do? |
@domenic I think the code in question is here: I don't think we could use Not sure if there are other places that depend on it as well. @gsnedders, do you know? Any ideas for how we could make this trap go away? |
The fundamental issue is we need some way to return from an Currently we do this by creating a listener for One possible option would be to instead save the callback function on the global (on something like |
@TimothyGu, WDYT, is this a problem that is important to fix? |
Navigating the window already doesn't work, I think. Fundamentally I'm not aware of any* way to create a solution that's totally transparent. You either need to play in the global scope of the test, or give the test a window but accept that properties like
|
Personally I think playing in the global scope of the test is much less dangerous than messing with web platform features that might themselves be under test. |
When run through
./wpt run
, the test window is created by another window throughwindow.open()
, soopener
is notnull
in the main page (when we expect it to benull
).@foolip, can you double check this looks correct?