chromium/third_party/blink/web_tests/wpt_internal/forms/file/file-input-webkitdirectory-key-other.html

<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<title>INPUT TYPE=FILE WEBKITDIRECTORY and key events - Other keys</title>
<input type="file" webkitdirectory>
<script type="module">
import {mockFileChooserFactory} from '../resources/mock-file-chooser.js';

promise_test(_ => {
  const promise = new Promise((resolve, reject) => {
    mockFileChooserFactory.addEventListener(
        'open', () => reject('chooser opened unexpectedly'));
    setTimeout(resolve, 10);
  });

  const file = document.querySelector('input');
  file.focus();
  ['x', '0', 'ArrowRight', 'ControlLeft'].forEach(key => {
    // Despite the name, 'keyDown' simulates a full down/press/up sequence.
    eventSender.keyDown(key, []);
  });
  return promise;
}, 'pressing a key other than Enter or Space with focus on a webkitdirectory file input element does not launch a chooser');
</script>