Skip to content

Crashtests with test-wait don't wait #33342

@jdm

Description

@jdm

From https://web-platform-tests.org/writing-tests/crashtest.html:

In some cases crashtests may need to perform work after the initial page load. In this case the test may specify a class=test-wait attribute on the root element. The test will not complete until that attribute is removed from the root. At the time when the test would otherwise have ended a TestRendered event is emitted; test authors can use this event to perform modifications that are guaranteed not to be batched with the initial paint. This matches the behaviour of [reftests](https://web-platform-tests.org/writing-tests/reftests.html).

Servo only checks for reftest-wait right now, so any crashtest that relies on test-wait exits very quickly:

// Checks if the html element has reftest-wait attribute present.
// See http://testthewebforward.org/docs/reftests.html
let html_element = document.GetDocumentElement();
let reftest_wait = html_element.map_or(false, |elem| {
elem.has_class(&atom!("reftest-wait"), CaseSensitivity::CaseSensitive)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testingE-less-complexStraightforward. Recommended for a new contributor.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions