tor-browser

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

format-comments.any.js (645B)


      1 // META: title=EventSource: comment fest
      2 
      3      var test = async_test()
      4      test.step(function() {
      5        var longstring = (new Array(2*1024+1)).join("x"), // cannot make the string too long; causes timeout
      6            message = encodeURI("data:1\r:\0\n:\r\ndata:2\n:" + longstring + "\rdata:3\n:data:fail\r:" + longstring + "\ndata:4\n"),
      7            source = new EventSource("resources/message.py?message=" + message + "&newline=none")
      8        source.onmessage = function(e) {
      9          test.step(function() {
     10            assert_equals("1\n2\n3\n4", e.data)
     11            source.close()
     12          })
     13          test.done()
     14        }
     15      })