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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion xhr/abort-after-stop.htm
Expand Up @@ -20,8 +20,11 @@
client.open("GET", "resources/delay.py?ms=3000", true);
client.send(null);
test.step_timeout(() => {
assert_equals(abortFired, true);
test.step(t => assert_equals(abortFired, true));
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.

}, 200);
window.stop();
});
Expand Down