layout/forms/test/test_bug644542.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=644542
     5 -->
     6 <head>
     7   <title>Test for Bug 644542</title>
     8   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
     9   <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
    10   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    11   <style type="text/css">
    12     select:after {
    13 	    content: ' appended string';
    14     }
    15   </style>
    16 </head>
    17 <body>
    18 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=644542">Mozilla Bug 644542</a>
    19 <p id="display">
    20   <form method="post" action="">
    21     <select id="select">
    22       <option value="1">1</option>
    23       <option value="2">2</option>
    24     </select>
    25   </form>
    26 </p>
    27 <div id="content" style="display: none">
    29 </div>
    30 <pre id="test">
    31 <script type="application/javascript">
    33 /** Test for Bug 644542 **/
    35 var select = document.getElementById("select");
    37 var clicks = 0;
    39 function click() {
    40     synthesizeMouseAtCenter(select, { });
    41     ++clicks;
    43     // At least two clicks were required for bug 644542, sometimes more;
    44     // delay is long enough that this doesn't look like a double
    45     // click, and also allows time for popup to show and for painting.
    46     setTimeout(clicks < 4 ? click : done, 500);
    47 }
    49 function done() {
    50     ok(true, "No crash on opening dropdown");
    51     SimpleTest.finish();
    52 }
    54 SimpleTest.waitForExplicitFinish();
    55 // waitForFocus is most likely not the right thing to wait for, but
    56 // without this the first click is ineffective (even with a reflow forced
    57 // before synthesizeMouse).
    58 SimpleTest.waitForFocus(click);
    59 </script>
    60 </pre>
    61 </body>
    62 </html>

mercurial