Files
tubestation/testing/web-platform/tests/eventsource/eventsource-request-cancellation.window.js
Jonathan Lee d00cec409a Bug 1895562 [wpt PR 46143] - [eventsource] Repair eventsource-request-cancellation.window.js, a=testonly
Automatic update from web-platform-tests
[eventsource] Repair `eventsource-request-cancellation.window.js`

https://crrev.com/c/5236256 missed one misnamed test. The suffix should
just be `.window.js` [0], not `.any.window.js`.

[0]: https://github.com/web-platform-tests/wpt/pull/29765#discussion_r697208154

Bug: None
Change-Id: I9ce91e99a063be1efa37e68b0777e256023680ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5519970
Auto-Submit: Jonathan Lee <jonathanjlee@google.com>
Commit-Queue: Weizhong Xia <weizhong@google.com>
Reviewed-by: Weizhong Xia <weizhong@google.com>
Cr-Commit-Position: refs/heads/main@{#1297590}

--

wpt-commits: 93ca7d336321a45f1bf1bbd63163b1e3ec6ae01f
wpt-pr: 46143
2024-05-14 07:22:22 +00:00

22 lines
838 B
JavaScript

// META: title=EventSource: request cancellation
var t = async_test();
onload = t.step_func(function() {
var url = "resources/message.py?sleep=1000&message=" + encodeURIComponent("retry:1000\ndata:abc\n\n");
var es = new EventSource(url);
es.onerror = t.step_func(function() {
assert_equals(es.readyState, EventSource.CLOSED)
t.step_timeout(function () {
assert_equals(es.readyState, EventSource.CLOSED,
"After stopping the eventsource readyState should be CLOSED")
t.done();
}, 1000);
});
t.step_timeout(function() {
window.stop()
es.onopen = t.unreached_func("Got open event");
es.onmessage = t.unreached_func("Got message after closing source");
}, 0);
});