chromium/third_party/blink/web_tests/external/wpt/html/webappapis/user-prompts/cannot-show-simple-dialogs/support/confirm.html

<script>
  function handleEvent(e) {
    var conf = window.confirm('Confirm Dialog');
    if (conf == false) {
      window.parent.postMessage('pass', '*');
    } else {
      window.parent.postMessage('fail', '*');
    }
  }
  window.addEventListener('message', handleEvent);
</script>