| <!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true IOSFormControlRefreshEnabled=false ] --> |
| |
| <html> |
| <head> |
| <meta name="viewport" content="width=device-width"> |
| <style> |
| </style> |
| |
| <script src="resources/zooming-test-utils.js"></script> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.waitUntilDone(); |
| } |
| |
| var uiScriptHasCompleted = false; |
| var oninputHasBeenHandled = false; |
| |
| function getUIScript(x, y) |
| { |
| return ` |
| (function() { |
| uiController.didShowKeyboardCallback = function() { |
| uiController.selectFormAccessoryPickerRow(3); |
| uiController.dismissFormAccessoryView(); |
| uiController.uiScriptComplete(); |
| } |
| uiController.singleTapAtPoint(${x}, ${y}, function() {}); |
| })();` |
| } |
| |
| function checkDone() |
| { |
| if (oninputHasBeenHandled && uiScriptHasCompleted) |
| testRunner.notifyDone(); |
| } |
| |
| function handleValueChanged(value) |
| { |
| document.getElementById("console").textContent = "Successfully handled oninput, value is now \"" + value.toLowerCase() + "\""; |
| oninputHasBeenHandled = true; |
| checkDone(); |
| } |
| |
| function doTest() |
| { |
| if (!window.testRunner || !testRunner.runUIScript) |
| return; |
| |
| var targetElement = document.getElementsByTagName('select')[0]; |
| var point = getPointInsideElement(targetElement, 10, 10); |
| |
| testRunner.runUIScript(getUIScript(point.x, point.y), function() { |
| uiScriptHasCompleted = true; |
| checkDone(); |
| }); |
| } |
| |
| window.addEventListener('load', doTest, false); |
| </script> |
| </head> |
| <body> |
| |
| <p>Tests that a basic select element works</p> |
| |
| <select oninput="handleValueChanged(this.value)"> |
| <option>January</option> |
| <option>February</option> |
| <option>March</option> |
| <option>April</option> |
| <option>May</option> |
| <option>June</option> |
| <option>July</option> |
| <option>August</option> |
| <option>September</option> |
| <option>October</option> |
| <option>November</option> |
| <option>December</option> |
| </select> |
| |
| <div id="console">Failed to handle oninput<div> |
| |
| </body> |
| </html> |