Skip to content
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

prevent harness timeout after calling window.stop() #9973

Closed
wants to merge 1 commit into from
Closed

prevent harness timeout after calling window.stop() #9973

wants to merge 1 commit into from

Conversation

anthumchris
Copy link
Member

@anthumchris anthumchris commented Mar 12, 2018

window.stop() prevents window.onload from firing, which causes a harness timeout
This fixes that, and the natural flow of things returns after window.stop().

Relates to #9959

window.stop() prevents window.onload from firing, which causes a harness timeout
This fixes that, and the natural flow of things returns after window.stop()
@w3c-bots
Copy link

w3c-bots commented Mar 12, 2018

Build PASSED

Started: 2018-03-13 08:31:20
Finished: 2018-03-13 08:44:29

View more information about this build on:

test.done();

// Prevent harness timeout caused by window.stop() preventing "load" event
window.dispatchEvent(new Event('load'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this emulate some code in the harness that dispatches a load event? How does this work?

cc @jgraham

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. Normally, window.onload is fired, which triggers test_environment.add_on_loaded_callback to be called. window.stop() prevents that being called, so we invoke it manually after the tests run and complete.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I think @jgraham needs to sign off on this. It seems we might want dedicated API instead so we can identify the tests that need this more easily.

@Ms2ger
Copy link
Contributor

Ms2ger commented Mar 16, 2018

Would it also work to move the code into an iframe or something?

@zcorpan
Copy link
Member

zcorpan commented May 31, 2018

This was fixed in a different way in aa09129

I think a third way to solve this would be to use setup({explicit_done: true}) and call done() at the end.

@zcorpan zcorpan closed this May 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants