<!DOCTYPE html>
<meta name=fuzzy content="maxDifference=0-3; totalPixels=0-1000">
<script>
testRunner.dumpAsText();
testRunner.waitUntilDone();
</script>
<script src="../../../resources/testdriver.js"></script>
<script src="../../../resources/testdriver-vendor.js"></script>
<script src='../resources/picker-common.js'></script>
<script src='color-picker-appearance-no-movement-helper.js'></script>
<input type='color' id='color' value='#FF0000'>
<p id='description' style='opacity: 0'></p>
<div id='console' style='opacity: 0'></div>
<script>
window.onload = () => {
let descriptionContainer = document.getElementById('description');
openPicker(document.getElementById('color'))
.then(() => {
descriptionContainer.append('Popup opened.', document.createElement('br'));
internals.pagePopupWindow.focus();
const popupDocument = internals.pagePopupWindow.document;
const hueSlider = popupDocument.querySelector('hue-slider');
const hueSliderRect = hueSlider.getBoundingClientRect();
const hueSliderSelectionRing = popupDocument.querySelector('hue-slider > color-selection-ring');
eventSender.mouseMoveTo(hueSliderRect.right, hueSliderRect.top);
eventSender.mouseDown();
eventSender.mouseUp();
let hueSliderSelectionRingCurrentLeft = hueSliderSelectionRing.left;
let hueSliderSelectionRingCurrentTop = hueSliderSelectionRing.top;
eventSender.keyDown('ArrowRight');
logKeyboardMovementResult(descriptionContainer, 'ArrowRight', 'hue slider', hueSliderSelectionRing,
hueSliderSelectionRingCurrentLeft, hueSliderSelectionRingCurrentTop);
hueSliderSelectionRingCurrentLeft = hueSliderSelectionRing.left;
hueSliderSelectionRingCurrentTop = hueSliderSelectionRing.top;
eventSender.keyDown('ArrowRight', ['ctrlKey']);
logKeyboardMovementResult(descriptionContainer, 'ctrlKey+ArrowRight', 'hue slider', hueSliderSelectionRing,
hueSliderSelectionRingCurrentLeft, hueSliderSelectionRingCurrentTop);
descriptionContainer.append('TEST COMPLETE');
testRunner.notifyDone();
})
.catch((e) => {
descriptionContainer.append('Popup did not open.' + e, document.createElement('br'));
testRunner.notifyDone();
});
};
</script>