dom/events/test/test_bug489671.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 <!doctype html>
     2 <html>
     3 <!--
     4 https://bugzilla.mozilla.org/show_bug.cgi?id=489671
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 489671</title>
     9   <script src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <link rel="stylesheet" href="/tests/SimpleTest/test.css">
    11 </head>
    12 <body>
    13 <a target="_blank"
    14    href="https://bugzilla.mozilla.org/show_bug.cgi?id=489671"
    15    >Mozilla Bug 489671</a>
    16 <p id="display" onclick="queueNextTest(); throw 'Got click 1';"></p>
    17 <script>
    18 // override window.onerror so it won't see our exceptions
    19 window.onerror = function() {}
    21 var testNum = 0;
    22 function doTest() {
    23   switch(testNum++) {
    24     case 0:
    25       var event = document.createEvent("MouseEvents");
    26       event.initMouseEvent("click", true, true, document.defaultView,
    27                            0, 0, 0, 0, 0, false, false, false, false, 0, null);
    28       $("display").dispatchEvent(event);
    29       break;
    30     case 1:
    31       var script = document.createElement("script");
    32       script.textContent = "queueNextTest(); throw 'Got click 2'";
    33       document.body.appendChild(script);
    34       break;
    35     case 2:
    36       window.setTimeout("queueNextTest(); throw 'Got click 3'", 0);
    37       break;
    38     case 3:
    39       SimpleTest.endMonitorConsole();
    40       return;
    41   }
    42 }
    43 function queueNextTest() { SimpleTest.executeSoon(doTest); }
    45 SimpleTest.waitForExplicitFinish();
    46 SimpleTest.monitorConsole(SimpleTest.finish, [
    47   { errorMessage: "uncaught exception: Got click 1" },
    48   { errorMessage: "uncaught exception: Got click 2" },
    49   { errorMessage: "uncaught exception: Got click 3" }
    50 ]);
    52 doTest();
    53 </script>
    54 </body>
    55 </html>

mercurial