Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Side by Side Diff: LayoutTests/fast/dom/promise-rejection-events-attached-in-event.html

Issue 1179113007: Implement onunhandledrejection / onrejectionhandled events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698