<!DOCTYPE html>
<meta name=fuzzy content="maxDifference=0-3; totalPixels=0-1000">
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../resources/testdriver.js"></script>
<script src="../../../resources/testdriver-vendor.js"></script>
<script src="../resources/common.js"></script>
<script src="../resources/picker-common.js"></script>
<script src="../calendar-picker/resources/calendar-picker-common.js"></script>
<input type="time" id="time" value="14:15:00" step="1">
<script>
let t = async_test('Test select value in time popup using keyboard');
function selectValue() {
let timeElement = document.getElementById("time");
timeElement.addEventListener("change", t.step_func_done(() => {
assert_equals(timeElement.value, "00:18:54");
}));
// change hours value
eventSender.keyDown('ArrowUp');
eventSender.keyDown('ArrowUp');
// move to minutes column
eventSender.keyDown('ArrowRight');
// change minutes value
eventSender.keyDown('ArrowDown');
eventSender.keyDown('ArrowDown');
eventSender.keyDown('ArrowDown');
// move to seconds column
eventSender.keyDown('ArrowRight');
// change seconds value
eventSender.keyDown('ArrowUp');
eventSender.keyDown('ArrowUp');
eventSender.keyDown('ArrowUp');
eventSender.keyDown('ArrowUp');
eventSender.keyDown('ArrowUp');
eventSender.keyDown('ArrowUp');
// move to ampm column
eventSender.keyDown('ArrowRight');
// change ampm value
eventSender.keyDown('ArrowDown');
// submit the new value
eventSender.keyDown('Enter');
}
t.step(() => {
openPickerDeprecatedJsTest(document.getElementById('time'), t.step_func(selectValue));
});
</script>