tor-browser

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

request-status-error.window.js (813B)


      1 // META: title=EventSource: incorrect HTTP status code
      2      function statusTest(status) {
      3        var test = async_test(document.title + " (" + status +")")
      4        test.step(function() {
      5          var source = new EventSource("resources/status-error.py?status=" + status)
      6          source.onmessage = function() {
      7            test.step(function() {
      8              assert_unreached()
      9            })
     10            test.done()
     11          }
     12          source.onerror = function() {
     13            test.step(function() {
     14              assert_equals(this.readyState, this.CLOSED)
     15            }, this)
     16            test.done()
     17          }
     18        })
     19      }
     20      statusTest("204")
     21      statusTest("205")
     22      statusTest("210")
     23      statusTest("299")
     24      statusTest("404")
     25      statusTest("410")
     26      statusTest("503")