diff --git a/rfcs/testdriver_in_other_types.md b/rfcs/testdriver_in_other_types.md new file mode 100644 index 00000000..f85df8a6 --- /dev/null +++ b/rfcs/testdriver_in_other_types.md @@ -0,0 +1,152 @@ +# RFC 211: Support testdriver.js in other test types + +## Summary + +Allow reftests, print-reftests, and crashtests to use `testdriver.js`, and add +the necessary support to `wpt {run,manifest,lint}`. + +## Motivation + +[`testdriver.js`][0] provides APIs that allow tests to send WebDriver-like +commands from client-side JavaScript. +Tests often use testdriver.js to access powerful capabilities that would +normally not be automatable because the web platform does not expose them. + +Currently, only [testharness tests] may use testdriver.js. +However, test authors [have expressed interest] in extending testdriver.js +support to [reftests], WPT's main source of rendering coverage. +The features they wish to test with respect to rendering are often gated on +user activation or require pointer input, which can't be obtained without +testdriver.js or manual interaction. +The table below lists some use cases, and (if applicable) tests already written: + +| Tests | testdriver.js usage | Purpose | +| --- | --- | --- | +| [`fullscreen/`][1] | `bless()` | Provide [required transient activation][2] | +| [`customizable-select/`][3] | `bless()`, `click()` | Provide transient activation [required to show `` picker in mainstream browsers is rendered + in a separate popup window that won't be captured in a reftest screenshot. + In those cases, testdriver support can still help drive additional + interoperability and infrastructure improvements that may be required to make + those features fully testable. +* Opening up testdriver to the other test types may encourage authors to write + unnecessarily JavaScript-heavy tests. + Test reviewers should exercise their judgement in these cases. + +[execute-async-script]: https://github.com/web-platform-tests/wpt/blob/f3dcc205a202467a922386036791372cd3e372fd/tools/wptrunner/wptrunner/executors/executorwebdriver.py#L969 +[take-screenshot]: https://github.com/web-platform-tests/wpt/blob/f3dcc205a202467a922386036791372cd3e372fd/tools/wptrunner/wptrunner/executors/executorwebdriver.py#L1079