blob: 76731646a0db6670b82a9f179ec7e7e44cb502f9 [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div style="height: 100px; overflow: scroll;">
<select multiple size="3" id="listbox">
<option>item 1</option>
<option>item 2</option>
<option>item 3</option>
<div style="height: 100px;">
<div id="log"></div>
test(function() {
var changeEventFired = false;
var listbox = document.getElementById("listbox");
listbox.addEventListener("change", function() {
changeEventFired = true;
if (!window.eventSender)
var x = listbox.offsetLeft + listbox.offsetWidth / 2;
var y = listbox.offsetTop + 5;
eventSender.dragMode = false;
eventSender.mouseMoveTo(x, y);
// Move outside of listbox and then release mouse.
eventSender.mouseMoveTo(x + 1, y);
eventSender.mouseMoveTo(x + listbox.offsetWidth, y);
assert_true(changeEventFired, "changeEventFired");
}, "Event listener on the select element should be triggered.");