tor-browser

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

format-field-id-null.window.js (722B)


      1 [
      2  "\u0000\u0000",
      3  "x\u0000",
      4  "\u0000x",
      5  "x\u0000x",
      6  " \u0000"
      7 ].forEach(idValue => {
      8  const encodedIdValue = encodeURIComponent(idValue);
      9  async_test(t => {
     10    const source = new EventSource("resources/last-event-id.py?idvalue=" + encodedIdValue);
     11    t.add_cleanup(() => source.close());
     12    let seenhello = false;
     13    source.onmessage = t.step_func(e => {
     14      if (e.data == "hello" && !seenhello) {
     15        seenhello = true;
     16        assert_equals(e.lastEventId, "");
     17      } else if(seenhello) {
     18        assert_equals(e.data, "hello");
     19        assert_equals(e.lastEventId, "");
     20        t.done();
     21      } else
     22        assert_unreached();
     23    });
     24  }, "EventSource: id field set to " + encodedIdValue);
     25 });