Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ResourceTiming style guide to explain asserts vs. errors #27707

Merged
merged 1 commit into from
Feb 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions resource-timing/CodingConventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ with recurring patterns.
web performance APIs, in general).
* Prefer [`fetch_tests_from_window`][3] to collect test results from embedded
iframes instead of hand-rolled `postMessage` approaches
* Use the [`assert_*`][4] family of functions to check conformance to the spec
but throw exceptions explicitly when the test itself is broken.
* A failed assert indicates "the implementation doesn't conform to the
spec"
* Other uncaught exceptions indicate "the test case itself has a bug"
* Where possible, we want tests to be scalable - adding another test case
should be as simple as calling the tests with new parameters, rather than
copying an existing test and modifying it.

[1]: https://www.w3.org/TR/resource-timing-2/
[2]: https://web-platform-tests.org/writing-tests/testharness-api.html#promise-tests
[3]: https://web-platform-tests.org/writing-tests/testharness-api.html#consolidating-tests-from-other-documents
[4]: https://web-platform-tests.org/writing-tests/testharness-api.html#list-of-assertions