tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

format-field-parsing.any.js (554B)


      1 // META: title=EventSource: field parsing
      2      var test = async_test()
      3      test.step(function() {
      4        var message = encodeURI("data:\0\ndata:  2\rData:1\ndata\0:2\ndata:1\r\0data:4\nda-ta:3\rdata_5\ndata:3\rdata:\r\n data:32\ndata:4\n"),
      5            source = new EventSource("resources/message.py?message=" + message + "&newline=none")
      6        source.onmessage = function(e) {
      7          test.step(function() {
      8            assert_equals(e.data, "\0\n 2\n1\n3\n\n4")
      9            source.close()
     10          })
     11          test.done()
     12        }
     13      })