-
Notifications
You must be signed in to change notification settings - Fork 72
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
Add support for testing the WebExtensions API in WPT #219
base: master
Are you sure you want to change the base?
Conversation
rfcs/web_extensions.md
Outdated
Because these tests won’t leverage `testharness.js` directly, we’ve introduced a new | ||
`testharness.js`, `.extension.js`, that will create the necessary boilerplate to | ||
convert the `browser.test` assertions into the corresponding assertions in the test | ||
harness. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably care to some extent about how easy/difficult it is to write tests without using extension.js
.
Rather than putting all the code necessary to map from browser.test
to testharness.js
in the server-generated wrapper, it would probably be better to put it into a separate file — which then gets included (along with testharness and testdriver) by the server-generated wrapper?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have actually tried to implement the proposal for executorsafari.py
in web-platform-tests/wpt#50648 (comment) and I think it would be easier to integrate the tests without adding extension.js
and using regular testharness.js tests. I think something like this would work:
// META: script=/resources/testdriver.js?feature=bidi
// META: script=/resources/testdriver-vendor.js
// META: script=/web-extension/resources/webextension-test.js
webextension_test(async () => {
// Call for illustrative purposes, in practice, webextension_test
// defined in webextension-test.js can implement it.
await test_driver.bidi.webExtension.install();
}, test_desc);
A problem with the current approach is that the infrastructure does not detect the ?feature=bidi
inside the server-generated wrapper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is a runnable implementation of this web-platform-tests/wpt#51090
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than putting all the code necessary to map from browser.test to testharness.js in the server-generated wrapper, it would probably be better to put it into a separate file — which then gets included (along with testharness and testdriver) by the server-generated wrapper?
@gsnedders what would be the benefits of that approach?
Can we get an update here to detail the current proposal? At the moment what's in the RFC doesn't seem to match what's actually in the patch. My understanding is that the proposal is for a new test wrapper indicated by |
This RFC documents our proposal for adding support for testing the WebExtensions API in the web platform tests.
No description provided.