chromium/third_party/blink/web_tests/external/wpt/html/semantics/forms/the-input-element/resources/show-picker-child-iframe.html

<!DOCTYPE html>
<title>Test showPicker() in an iframe</title>
<script type=module>
import inputTypes from "./../input-types.js";

const urlParams = new URLSearchParams(location.search);
const documentDomain = urlParams.get('documentDomain');
if (documentDomain) {
  document.domain = documentDomain;
}

let securityErrors = [];
for (const inputType of inputTypes) {
  const input = document.createElement("input");
  input.setAttribute("type", inputType);

  try {
    input.showPicker();
  } catch (error) {
    if (error instanceof DOMException && error.name == 'SecurityError') {
      securityErrors.push(inputType);
    }
  }
}
parent.postMessage(securityErrors.join(','), "*");
</script>