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

Side by Side Diff: LayoutTests/fast/dom/promise-rejection-events-onerror.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 setup({
8 allow_uncaught_exception: true
9 });
10 async_test(function(t) {
11 var e = new Error('e');
12 var e2 = new Error('e2');
13 window.onerror = function (msg, url, line, col, error) {
14 t.step(function() {
15 assert_equals(msg, 'Uncaught Error: e2');
16 assert_equals(error, e2);
17 });
18 t.done();
19 };
20 window.onrejectionhandled = function() {
21 throw e2;
22 };
23 var p = Promise.reject(e);
24 setTimeout(function() {
25 try {
26 p.catch(function() {});
27 } catch (e) {
28 assert_unreached('attaching a handler should not throw an error');
29 }
30 }, 1);
31 }, 'Throwing inside an unhandledrejection handler invokes the error handler.');
32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698