|
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"> |
|
28 |
|
29 </div> |
|
30 <pre id="test"> |
|
31 <script type="application/javascript"> |
|
32 |
|
33 /** Test for Bug 644542 **/ |
|
34 |
|
35 var select = document.getElementById("select"); |
|
36 |
|
37 var clicks = 0; |
|
38 |
|
39 function click() { |
|
40 synthesizeMouseAtCenter(select, { }); |
|
41 ++clicks; |
|
42 |
|
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 } |
|
48 |
|
49 function done() { |
|
50 ok(true, "No crash on opening dropdown"); |
|
51 SimpleTest.finish(); |
|
52 } |
|
53 |
|
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> |