From fe369f9f612ffa368d71dc48fe121fe0d3389b3a Mon Sep 17 00:00:00 2001 From: Maksim Sadym Date: Mon, 11 Nov 2024 17:55:10 +0100 Subject: [PATCH 1/4] RFC XXX: Add ?feature query parameter to testdriver.js --- rfcs/testdriver-features.md | 104 ++++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 rfcs/testdriver-features.md diff --git a/rfcs/testdriver-features.md b/rfcs/testdriver-features.md new file mode 100644 index 00000000..9a1ad7af --- /dev/null +++ b/rfcs/testdriver-features.md @@ -0,0 +1,104 @@ +# RFC XXX: Add `?feature` query parameter to `testdriver.js` + +## Summary + +This RFC is an alternative to [RFC 212](https://github.com/web-platform-tests/rfcs/pull/212). It proposes adding a query parameter `?features` to `testdriver.js`. At the moment the only supported feature will be `bidi`, which will be used to enable the [testdriver BiDi API](https://github.com/web-platform-tests/rfcs/blob/master/rfcs/testdriver_bidi.md) for specific WPT tests, The supported features can be extended by other RFCs if required. The feature `bidi`, applicable to HTML and JS files, would let test runners choose between [**WebDriverProtocol**](https://github.com/web-platform-tests/wpt/blob/9c76757f5332678f9952f6ccb3824f62d30eca1f/tools/wptrunner/wptrunner/executors/executorwebdriver.py#L644) and [**WebDriverBidiProtocol**](https://github.com/web-platform-tests/wpt/blob/9c76757f5332678f9952f6ccb3824f62d30eca1f/tools/wptrunner/wptrunner/executors/executorwebdriver.py#L736). This approach does not require all the browsers to implement WebDriver BiDi. + +[Prototype](https://github.com/web-platform-tests/wpt/pull/48622). + +## Background + +[RFC 185](https://github.com/web-platform-tests/rfcs/blob/master/rfcs/testdriver_bidi.md) proposes adding BiDi support to `testdriver.js`, which involves using [WebDriverBidiProtocol](https://github.com/web-platform-tests/wpt/blob/9c76757f5332678f9952f6ccb3824f62d30eca1f/tools/wptrunner/wptrunner/executors/executorwebdriver.py#L736) instead of [WebDriverProtocol](https://github.com/web-platform-tests/wpt/blob/9c76757f5332678f9952f6ccb3824f62d30eca1f/tools/wptrunner/wptrunner/executors/executorwebdriver.py#L644) for test runners that use the WebDriver protocol. However, this change could cause regressions in tests that don't use the testdriver BiDi API due to unintended side effects of the transport change. To address this, the query parameter `?features=bidi` in `testdriver.js` will inform the test runner whether the given test requires the testdriver BiDi API, allowing the runner to choose the appropriate transport, if the default one does not support BiDi protocol parts. + +If at a certain point all the browsers implement testdriver BiDi and enable it by default, this flag can be deprecated. + +## Details + +### Examples + +[html test](https://github.com/web-platform-tests/wpt/blob/9395d384f5c69a9a3a7fc4de04249f77500b2d3f/infrastructure/webdriver/bidi/subscription.html#L3) +```javascript + + +Test console log are present + + + + + - +