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/event-data.html | |
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/event-data.html')
-rw-r--r-- | testing/web-platform/tests/eventsource/event-data.html | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/testing/web-platform/tests/eventsource/event-data.html b/testing/web-platform/tests/eventsource/event-data.html new file mode 100644 index 000000000..8f74a0178 --- /dev/null +++ b/testing/web-platform/tests/eventsource/event-data.html @@ -0,0 +1,44 @@ +<!doctype html> +<html> + <head> + <title>EventSource: lines and data parsing</title> + <meta rel=help href="http://dev.w3.org/html5/eventsource/#event-stream-interpretation"> + <meta rel=assert title="If the line is empty (a blank line) Dispatch the event, as defined below."> + <meta rel=assert title="If the line starts with a U+003A COLON character (:) Ignore the line."> + <meta rel=assert title="If the line contains a U+003A COLON character (:) + Collect the characters on the line before the first U+003A COLON character (:), and let field be that string. + Collect the characters on the line after the first U+003A COLON character (:), and let value be that string. If value starts with a U+0020 SPACE character, remove it from value. + Process the field using the steps described below, using field as the field name and value as the field value. + "> + <meta rel=assert title="Otherwise, the string is not empty but does not contain a U+003A COLON character (:) +Process the field using the steps described below, using the whole line as the field name, and the empty string as the field value. + "> + + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + </head> + <body> + <div id="log"></div> + <script> + var test = async_test(document.title); + test.step(function() { + var source = new EventSource("resources/message2.py"), + counter = 0; + source.onmessage = test.step_func(function(e) { + if(counter == 0) { + assert_equals(e.data,"msg\nmsg"); + } else if(counter == 1) { + assert_equals(e.data,""); + } else if(counter == 2) { + assert_equals(e.data,"end"); + source.close(); + test.done(); + } else { + assert_unreached(); + } + counter++; + }); + }); + </script> + </body> +</html> |