chromium/third_party/blink/web_tests/fast/forms/color/color-picker-escape-cancellation-revert.html

<!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='../../../fast/forms/resources/picker-common.js'></script>

<input type='color' id='color' value='#3d5a66'>
<script>
'use strict';

promise_test(() => {
  let colorControl = document.getElementById('color');
  return openPicker(colorControl)
  .then(() => {
    internals.pagePopupWindow.focus();
    const popupDocument = internals.pagePopupWindow.document;
    const colorWell = popupDocument.querySelector('color-well');
    const colorWellRect = colorWell.getBoundingClientRect();
    eventSender.mouseMoveTo(colorWellRect.left + (colorWellRect.width * 2 / 10), colorWellRect.top + (colorWellRect.height * 3 / 10));
    eventSender.mouseDown();
    eventSender.mouseUp();
    assert_equals(colorControl.value, '#8fa8b3', 'Mouse input should have changed color value.');

    eventSender.mouseMoveTo(colorWellRect.left + (colorWellRect.width * 4 / 10), colorWellRect.top + (colorWellRect.height * 6 / 10));
    eventSender.mouseDown();
    eventSender.mouseUp();
    assert_equals(colorControl.value, '#3d5a66', 'Mouse input should have changed color back to original value.');
    eventSender.keyDown('Escape');
    assert_equals(internals.pagePopupWindow, null, 'Single escape should change popup since its value was switched back the value when opened');
  });
}, "Color picker: Pressing escape closes popup after value is changed and then set back to original value.");

</script>