dom/events/test/test_bug502818.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 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=502818
     5 -->
     6 <head>
     7   <title>Test for Bug 502818</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    10 </head>
    11 <body>
    12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=502818">Mozilla Bug 502818</a>
    13 <p id="display"></p>
    14 <div id="content" style="display: none">
    16 </div>
    17 <pre id="test">
    18 <script type="application/javascript">
    20 /** Test for Bug 502818 **/
    22   var count = 0;
    24   function listener(evt) {
    25     ++count;
    26     is(evt.foo, 'bar', "Event.prototype should be accessible from " + evt.type);
    27   }
    29   Event.prototype.foo = 'bar';
    30   window.addEventListener('DOMMouseScroll', listener, false);
    31   window.addEventListener('MozMousePixelScroll', listener, false);
    32   window.addEventListener('foobar', listener, false);
    34   var e = document.createEvent("mousescrollevents");
    35   e.initMouseScrollEvent("DOMMouseScroll", true, true, window,
    36                          0, 0, 0, 0, 0, false, false, false, false,
    37                          0, null, 1);
    38   window.dispatchEvent(e);
    40   e.initMouseScrollEvent("MozMousePixelScroll", true, true, window,
    41                          0, 0, 0, 0, 0, false, false, false, false,
    42                          0, null, 1);
    43   window.dispatchEvent(e);
    45   e.initMouseScrollEvent("foobar", true, true, window,
    46                          0, 0, 0, 0, 0, false, false, false, false,
    47                          0, null, 1);
    48   window.dispatchEvent(e);
    50   is(count, 3, "Wrong number tests run!");
    51 </script>
    52 </pre>
    53 </body>
    54 </html>

mercurial