Bug 1610316 [wpt PR 21269] - Make it clear that event handler callbacks require wrapping in promise_test, a=testonly
authorJames Graham <james@hoppipolla.co.uk>
Tue, 21 Jan 2020 10:55:51 +0000
changeset 573951 ff39e42be314c759b6661d238edc6722c09a0551
parent 573950 8a5ed04bc4071dfe2f49d482310442d521571e7f
child 573952 5d63921aa9d31e83a79c43c6ed90e09ae37c329c
push id12662
push userffxbld-merge
push dateMon, 10 Feb 2020 10:43:10 +0000
treeherdermozilla-beta@ace4081e8200 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1610316, 21269
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1610316 [wpt PR 21269] - Make it clear that event handler callbacks require wrapping in promise_test, a=testonly Automatic update from web-platform-tests Make it clear that event handler callbacks require wrapping in promise_test -- wpt-commits: e78c95ebf1cce550e9b7e55b281d4c10e9b99d48 wpt-pr: 21269
testing/web-platform/tests/docs/writing-tests/testharness-api.md
--- a/testing/web-platform/tests/docs/writing-tests/testharness-api.md
+++ b/testing/web-platform/tests/docs/writing-tests/testharness-api.md
@@ -175,18 +175,22 @@ promise_test(function() {
     });
 }, "Simple example");
 ```
 
 In the example above, `foo()` returns a Promise that resolves with the string
 "foo". The `test_function` passed into `promise_test` invokes `foo` and attaches
 a resolve reaction that verifies the returned value.
 
-Note that in the promise chain constructed in `test_function` assertions don't
-need to be wrapped in `step` or `step_func` calls.
+Note that in the promise chain constructed in `test_function`
+assertions don't need to be wrapped in `step` or `step_func`
+calls. However when mixing event handlers and `promise_test`, the
+event handler callback functions *do* need to be wrapped since an
+exception in these functions does not cause the promise chain to
+reject.
 
 Unlike Asynchronous Tests, Promise Tests don't start running until after the
 previous Promise Test finishes. [Under rare
 circumstances](https://github.com/web-platform-tests/wpt/pull/17924), the next
 test may begin to execute before the returned promise has settled. Use
 [add_cleanup](#cleanup) to register any necessary cleanup actions such as
 resetting global state that need to happen consistently before the next test
 starts.