<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<body>
<p>This test verifies a selectlist can refine the selection when we send keydown events consisting of Greek small characters.</p>
<selectlist id="selectlist">
<option value="-1">should not see me</option>
<option value="0">Α</option>
<option value="1">ΑΒ</option>
<option value="2">ΑΒΓ</option>
<option value="3">ΑΒΓΔ</option>
<option value="4">ΑΒΓΔΕ</option>
<option value="5">ΑΒΓΔΕΖ</option>
<option value="6">ΑΒΓΔΕΖΗ</option>
<option value="7">ΑΒΓΔΕΖΗΘ</option>
<option value="8">ΑΒΓΔΕΖΗΘΙ</option>
<option value="9">ΑΒΓΔΕΖΗΘΙΚ</option>
<option value="10">ΑΒΓΔΕΖΗΘΙΚΛ</option>
<option value="11">ΑΒΓΔΕΖΗΘΙΚΛΜ</option>
<option value="12">ΑΒΓΔΕΖΗΘΙΚΛΜΝ</option>
<option value="13">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞ</option>
<option value="14">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟ</option>
<option value="15">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠ</option>
<option value="16">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ</option>
<option value="18">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣ</option>
<option value="19">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤ</option>
<option value="20">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥ</option>
<option value="21">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦ</option>
<option value="22">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧ</option>
<option value="23">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨ</option>
<option value="24">ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ</option>
</selectlist>
<ul id="console"></ul>
</body>
<script>
// Set the input focus to the <select> element.
var selectlist = document.getElementById("selectlist");
selectlist.focus();
var base = 0x03B1;
for (var i = base; i <= 0x03C9; i++) {
test(() => {
// We can skip U+03C2 (`ς` - Greek Small Letter Final Sigma) because there
// are 2 lower case Sigma letters in the Greek alphabet, based on the
// position of the letter in the word. `ς` (0x03C2) for final position in
// word, `σ` (0x03C3) for the other positions.
if (i != 0x03C2) {
// Send a key event consisting of a Greek small character.
eventSender.keyDown(String.fromCharCode(i));
// Compare the value of this <selectlist> element with the expected result.
assert_equals(selectlist.value, (i - base).toString());
}
});
}
</script>
</html>