Commit 882078de authored by Mike Pennisi's avatar Mike Pennisi Committed by Commit Bot

Allow unhandled promise rejection in LayoutTest

This test is expected to cause unhandled promise rejections. Although
the test harness reports an error when it detects unhandled promise
rejections, they do not occur in this test until results have already
been reported.

In a forthcoming change to testharness.js [1], testing will pause until
"cleanup" code has completed. This change will delay the reporting of
results, and the previously-ignored unhandled rejections will interrupt
the results.

Ideally, the rejections could be handled with explicit code written for
this purpose. The particulars of this test make this impossible.
Instead, configure the test harness to allow unhandled promise
rejections.

[1] https://github.com/web-platform-tests/wpt/pull/8748

R=foolip@chromium.org, robertma@chromium.org

Bug: 867708
Change-Id: I7ac53d88424e80b89e9969312f8cbfeb0922f579
Reviewed-on: https://chromium-review.googlesource.com/1150882Reviewed-by: default avatarRobert Ma <robertma@chromium.org>
Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Commit-Queue: Philip Jägenstedt <foolip@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578830}
parent eaeee48e
......@@ -2,6 +2,11 @@
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
// Unhandled rejections must be permitted due to the expected unhandled
// reections described below.
setup({
allow_uncaught_exception: true
});
// Running put several times is necessary to trigger the crash, but running too
// many times causes the test to timeout on windows.
let putRunsLeft = 64;
......@@ -13,7 +18,8 @@ function fillStackThenCallPut(foo, request, response) {
} finally {
// This runs thousands of times, causing the console to spew "Uncaught
// (in promise) TypeError: Response body is already used" messages, but
// it's harmless.
// it's harmless. The rejection cannot be handled because the call
// stack is full.
if (putRunsLeft > 0) {
--putRunsLeft;
foo.put(request, response);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment