diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/eventsource/eventsource-request-cancellation.htm | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/eventsource/eventsource-request-cancellation.htm')
-rw-r--r-- | testing/web-platform/tests/eventsource/eventsource-request-cancellation.htm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/testing/web-platform/tests/eventsource/eventsource-request-cancellation.htm b/testing/web-platform/tests/eventsource/eventsource-request-cancellation.htm new file mode 100644 index 000000000..308e4d5d7 --- /dev/null +++ b/testing/web-platform/tests/eventsource/eventsource-request-cancellation.htm @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> + <head> + <title>EventSource: request cancellation</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id="log"></div> + <script> + 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) + setTimeout(t.step_func(function () { + assert_equals(es.readyState, EventSource.CLOSED, + "After stopping the eventsource readyState should be CLOSED") + t.done(); + }), 1000); + }); + + setTimeout(t.step_func(function() { + window.stop() + es.onopen = t.unreached_func("Got open event"); + es.onmessage = t.unreached_func("Got message after closing source"); + }), 0); + }); + </script> + </body> +</html> |