OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../../../fast/js/resources/js-test-pre.js"></script> |
| 5 <div id="host" tabindex="1"> |
| 6 <input id="target" type="color" value="#000000"> |
| 7 </div> |
| 8 <script> |
| 9 |
| 10 shadow = host.webkitCreateShadowRoot(); |
| 11 shadow.innerHTML = "<content></content>"; |
| 12 jsTestIsAsync = true; |
| 13 |
| 14 function waitUntilShown(then) |
| 15 { |
| 16 if (!testRunner.isChooserShown()) |
| 17 return window.setTimeout(function() { waitUntilShown(then); }, 0); |
| 18 then(); |
| 19 } |
| 20 |
| 21 function ensureOpeningFor(count, then) |
| 22 { |
| 23 shouldBeTrue("testRunner.isChooserShown()"); |
| 24 if (count) |
| 25 return window.setTimeout(function() { ensureOpeningFor(count -1, then);
}, 0); |
| 26 then(); |
| 27 } |
| 28 |
| 29 if (window.eventSender) { |
| 30 shouldBeFalse("testRunner.isChooserShown()"); |
| 31 eventSender.dragMode = false; |
| 32 eventSender.mouseMoveTo(target.offsetLeft, target.offsetTop + target.offsetHe
ight / 2); |
| 33 eventSender.mouseDown(); |
| 34 eventSender.mouseUp(); |
| 35 |
| 36 waitUntilShown(function() { |
| 37 testRunner.setWindowIsKey(false); // This triggers a style recalc. |
| 38 ensureOpeningFor(10, finishJSTest); // Try several times to ensure nothing
wrong happens asynchronously. |
| 39 }); |
| 40 } |
| 41 |
| 42 </script> |
| 43 <script src="../../../fast/js/resources/js-test-post.js"></script> |
| 44 </body> |
| 45 </html> |
OLD | NEW |