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