Skip to content

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

Closed
anthumchris wants to merge 1 commit into
web-platform-tests:masterfrom
anthumchris:xhr-abort-after-stop-fix
Closed

anthumchris wants to merge 1 commit into
web-platform-tests:masterfrom
anthumchris:xhr-abort-after-stop-fix

Conversation

@anthumchris

@anthumchris anthumchris commented Mar 12, 2018 •

Copy link
Copy Markdown
Member

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()
@ghost

ghost commented Mar 12, 2018 •

Copy link
Copy Markdown

Build PASSED

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

View more information about this build on:

Comment thread xhr/abort-after-stop.htm
test.done();

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

Copy link
Copy Markdown
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

@anthumchris anthumchris Mar 12, 2018 •

Copy link
Copy Markdown
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
Copy Markdown
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

Ms2ger commented Mar 16, 2018

Copy link
Copy Markdown
Contributor

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

@zcorpan

zcorpan commented May 31, 2018

Copy link
Copy Markdown
Member

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.

5 participants