chromium/third_party/blink/web_tests/fast/forms/suggestion-picker/date-suggestion-picker-step-attribute.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="../resources/picker-common.js"></script>
<script src="resources/suggestion-picker-common.js"></script>

<body style="background-color: #bbbbbb;">
<input type=date value="2012-01-01" step="2" list=suggestions>
<datalist id=suggestions>
  <option>2012-01-21</option>
  <option>2012-01-22</option>
  <option>2012-01-23</option>
  <option>2012-01-24</option>
  <option>2012-01-25</option>
  <option>2012-01-26</option>
  <option>2012-01-27</option>
  <option>2012-01-28</option>
  <option>2012-01-29</option>
  <option>2012-01-30</option>
  <option>2012-01-31</option>
  <option>2012-02-01</option>
</datalist>

<script>
window.onload = () => {
  const element = document.querySelector('input');
  promise_test(() => {
    return openPicker(element)
    .then(() => {
      internals.pagePopupWindow.focus();

      assert_equals(entryValues().length, 7);
      assert_equals(entryValues()[0], '2012-01-21');
      assert_equals(entryValues()[1], '2012-01-23');
      assert_equals(entryValues()[2], '2012-01-25');
      assert_equals(entryValues()[3], '2012-01-27');
      assert_equals(entryValues()[4], '2012-01-29');
      assert_equals(entryValues()[5], '2012-01-31');
      assert_equals(entryValues()[6], '@openCalendarPicker');

      return attemptToClosePicker(element);
    });
  },'Step attribute filters out suggestions');

  promise_test(() => {
    element.step = 5;
    return openPicker(element)
    .then(() => {
      internals.pagePopupWindow.focus();

      assert_equals(entryValues().length, 4);
      assert_equals(entryValues()[0], '2012-01-21');
      assert_equals(entryValues()[1], '2012-01-26');
      assert_equals(entryValues()[2], '2012-01-31');
      assert_equals(entryValues()[3], '@openCalendarPicker');

      return attemptToClosePicker(element);
    });
  },'Step attribute filters out suggestions - longer step');

  promise_test(() => {
    element.step = 30;
    return openPicker(element)
    .then(() => {
      internals.pagePopupWindow.focus();

      assert_equals(entryValues().length, 2);
      assert_equals(entryValues()[0], '2012-01-31');
      assert_equals(entryValues()[1], '@openCalendarPicker');

      return attemptToClosePicker(element);
    });
  },'Step attribute filters out suggestions - very long step');
};
</script>