OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <meta charset="utf-8"> |
| 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <script src="/cors/support.js?pipe=sub"></script> |
| 6 <link rel="help" href="https://html.spec.whatwg.org/#unhandled-promise-rejection
s"> |
| 7 <link rel="help" href="https://html.spec.whatwg.org/#muted-errors"> |
| 8 |
| 9 <body> |
| 10 <script> |
| 11 'use strict'; |
| 12 |
| 13 (function() { |
| 14 var resolveLoaded; |
| 15 var loadedPromise = new Promise(function(resolve) { resolveLoaded = resolve; }
); |
| 16 |
| 17 async_test(function(t) { |
| 18 addEventListener('unhandledrejection', t.unreached_func('unhandledrejection
event should never be triggered')); |
| 19 addEventListener('rejectionhandled', t.unreached_func('rejectionhandled even
t should never be triggered')); |
| 20 |
| 21 loadedPromise.then(t.step_func(function() { |
| 22 t.step_timeout(function() { |
| 23 t.done(); |
| 24 }, 1000); |
| 25 })); |
| 26 }, 'Promise rejection event should be muted for cross-origin non-CORS script')
; |
| 27 |
| 28 var scriptEl = document.createElement('script'); |
| 29 scriptEl.src = CROSSDOMAIN + 'support/promise-access-control.py?allow=false'; |
| 30 scriptEl.onload = resolveLoaded; |
| 31 document.body.appendChild(scriptEl); |
| 32 }()); |
| 33 </script> |
| 34 </body> |
OLD | NEW |