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.

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

mercurial