| <!DOCTYPE html> |
| <input id='textField' type='text' style="position:relative;"> <br> |
| <iframe onload="runTest();" id="anIFrame" style="left:50px;width:200px;height:200px;position:absolute;" src="resources/scrollable-iframe-with-click-strip.html"> </iframe> |
| <script src="../resources/js-test.js"></script> |
| <script> |
| |
| setPrintTestResultsLazily(); |
| description("For the bug that click on the green strip in the scrollable iframe will not make the iframe get the focus. crbug.com/531929") |
| |
| window.jsTestIsAsync = true; |
| |
| function runTest() { |
| document.getElementById("textField").focus(); |
| if (window.eventSender) { |
| var frame = document.getElementById("anIFrame"); |
| var frame_doc = window.frames[0].document; |
| var strip = frame_doc.getElementById("strip"); |
| |
| var x = frame.offsetLeft + strip.offsetLeft + 5; |
| var y = frame.offsetTop + 5; |
| |
| // send mouse event to click iframe's green strip; |
| eventSender.mouseMoveTo(x, y); |
| eventSender.mouseDown(); |
| eventSender.mouseUp(); |
| if (window.frames[0].document.hasFocus()) |
| debug("PASS"); |
| else |
| debug("FAIL"); |
| } |
| finishJSTest(); |
| } |
| </script> |