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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/promise-rejection-events-onerror.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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
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 <link rel="help" href="https://html.spec.whatwg.org/#runtime-script-errors">
6 <link rel="help" href="https://html.spec.whatwg.org/#unhandled-promise-rejection s">
7 <script>
8 'use strict';
9 setup({
10 allow_uncaught_exception: true
11 });
12 async_test(function(t) {
13 var e = new Error('e');
14 var e2 = new Error('e2');
15
16 window.onerror = function (msg, url, line, col, error) {
17 t.step(function() {
18 assert_equals(msg, 'Uncaught Error: e2');
19 assert_equals(error, e2);
20 });
21 t.done();
22 };
23
24 window.onrejectionhandled = function() {
25 // This should cause onerror
26 throw e2;
27 };
28
29 var p = Promise.reject(e);
30 setTimeout(t.step_func(function() {
31 // This will cause onrejectionhandled
32 p.catch(function() {});
33 }), 1);
34 }, 'Throwing inside an unhandledrejection handler invokes the error handler.');
35 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698