tor-browser

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

nonexistent-image.html (628B)


      1 <!DOCTYPE HTML>
      2 <meta charset="utf-8">
      3 <title>Loading an nonexisting image should fail; triggering appropriate events</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 
      7 <img>
      8 
      9 <script>
     10  async_test(function(t) {
     11    var img = document.querySelector("img");
     12    img.onload = this.step_func_done(function() {
     13      assert_unreached("image.onload() was not supposed to be called");
     14    });
     15    img.onerror = this.step_func_done(function(e) {
     16      assert_equals(e.type, "error", "image.onerror() called");
     17      t.done();
     18    });
     19    img.src = "404";
     20  });
     21 </script>