author | James Graham <james@hoppipolla.co.uk> |
Tue, 21 Jan 2020 10:55:51 +0000 | |
changeset 573951 | ff39e42be314c759b6661d238edc6722c09a0551 |
parent 573950 | 8a5ed04bc4071dfe2f49d482310442d521571e7f |
child 573952 | 5d63921aa9d31e83a79c43c6ed90e09ae37c329c |
push id | 12662 |
push user | ffxbld-merge |
push date | Mon, 10 Feb 2020 10:43:10 +0000 |
treeherder | mozilla-beta@ace4081e8200 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | testonly |
bugs | 1610316, 21269 |
milestone | 74.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
|
testing/web-platform/tests/docs/writing-tests/testharness-api.md | file | annotate | diff | comparison | revisions |
--- 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.