testing/web-platform/tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/allow-crossorigin.html
author Emilio Cobos Álvarez <emilio@crisal.io>
Thu, 10 Jul 2025 09:08:54 +0000 (2 hours ago)
changeset 795952 1d422913e1cb1658224a2d269f8e4c9e80032d29
parent 343568 91e8324552875e1e00cfec7064622571e7f39945
permissions -rw-r--r--
Bug 1976623 - Create drag popups eagerly for now. r=tnikkel,layout-reviewers Trivially restores pre-regression behavior, for now. Differential Revision: https://phabricator.services.mozilla.com/D256769
<!DOCTYPE html>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/cors/support.js?pipe=sub"></script>
<link rel="help" href="https://html.spec.whatwg.org/#unhandled-promise-rejections">
<link rel="help" href="https://html.spec.whatwg.org/#muted-errors">

<body>
<script>
'use strict';
setup({
  allow_uncaught_exception: true
});

async_test(function(t) {
  addEventListener('unhandledrejection', t.step_func(function(e) {
    assert_equals(e.reason, 42, 'reason should be the one given by the script');
    t.done();
  }));
}, 'Promise rejection event should be received for the cross-origin CORS script');

(function() {
  var scriptEl = document.createElement('script');
  scriptEl.src = CROSSDOMAIN + 'support/promise-access-control.py?allow=true';
  scriptEl.crossOrigin = 'anonymous';
  document.body.appendChild(scriptEl);
}());
</script>
</body>