<!DOCTYPE html>
<meta name=fuzzy content="maxDifference=0-3; totalPixels=0-1000">
<script>
testRunner.waitUntilDone();
</script>
<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='../../../fast/forms/resources/picker-common.js'></script>
<input type='color' id='color' value='#A8A8A8'>
<p id='description' style='opacity: 0'></p>
<div id='console' style='opacity: 0'></div>
<script>
let t = async_test('Color picker: Moving the color well\'s selection ring using accelerated keyboard movement.');
t.step(() => {
let colorControl = document.getElementById('color');
openPicker(colorControl)
.then(t.step_func_done(() => {
internals.pagePopupWindow.focus();
const popupDocument = internals.pagePopupWindow.document;
const colorWell = popupDocument.querySelector('color-well');
const colorWellRect = colorWell.getBoundingClientRect();
eventSender.mouseMoveTo(colorWellRect.right - 1, colorWellRect.top);
eventSender.mouseDown();
eventSender.mouseUp();
for (let i = 0; i < 5; i++) {
eventSender.keyDown('ArrowLeft', ['ctrlKey']);
}
const rValueContainer = popupDocument.getElementById('rValueContainer');
const gValueContainer = popupDocument.getElementById('gValueContainer');
const bValueContainer = popupDocument.getElementById('bValueContainer');
assert_equals(rValueContainer.value, '255');
assert_equals(gValueContainer.value, '112');
assert_equals(bValueContainer.value, '112');
}));
});
</script>