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> |
| 6 'use strict'; |
| 7 async_test(function(t) { |
| 8 var e = new Error('e'); |
| 9 var p = Promise.reject(e); |
| 10 |
| 11 window.onunhandledrejection = function(evt) { |
| 12 t.step(function() { |
| 13 assert_equals(evt.promise, p); |
| 14 assert_equals(evt.reason, e); |
| 15 }); |
| 16 var unreached = t.unreached_func('promise should not be fulfilled'); |
| 17 p.then(unreached, function(reason) { |
| 18 t.step(function() { |
| 19 assert_equals(reason, e); |
| 20 }); |
| 21 setTimeout(function() { t.done(); }, 10); |
| 22 }); |
| 23 }; |
| 24 |
| 25 window.onrejectionhandled = t.unreached_func('rejectionhandled event should no
t be invoked'); |
| 26 }, 'Attaching a handler in unhandledrejection should not trigger rejectionhandle
d.'); |
| 27 </script> |
OLD | NEW |