content/base/test/test_bug737087.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 <!DOCTYPE HTML>
     2 <!--
     3 https://bugzilla.mozilla.org/show_bug.cgi?id=737087
     4 -->
     5 <title>Test for Bug 737087</title>
     6 <script src="/tests/SimpleTest/SimpleTest.js"></script>
     7 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
     8 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=737087">Mozilla Bug 737087</a>
     9 <script>
    11 /** Test for Bug 737087 **/
    12 SimpleTest.waitForExplicitFinish();
    14 var bubbled = false;
    15 var capturedEvent = null;
    16 var inlineFiredEvent = null;
    18 addEventListener("error", function() { bubbled = true });
    19 addEventListener("error", function(e) {
    20   capturedEvent = e;
    21   is(typeof e, "object", "Error event must be object");
    22   is(Object.getPrototypeOf(e), Event.prototype, "Error event must be Event");
    23   is(e.bubbles, false, "e.bubbles must be false");
    24   is(e.cancelable, false, "e.cancelable must be false");
    25 }, true);
    27 addLoadEvent(function() {
    28   is(bubbled, false, "Error event must not bubble");
    29   isnot(capturedEvent, null, "Error event must be captured");
    30   isnot(inlineFiredEvent, null, "Inline error handler must fire");
    31   is(capturedEvent, inlineFiredEvent,
    32      "Same event must be handled by both handlers");
    33   SimpleTest.finish();
    34 });
    35 </script>
    36 <script src=nonexistent
    37   onerror="inlineFiredEvent = event"></script>

mercurial