Expose an API in mochitest-chrome and mochitest-browser to easily retrieve test file URLs
Categories
(Testing :: Mochitest, enhancement)
Tracking
(Not tracked)
People
(Reporter: ochameau, Assigned: ochameau)
Details
Attachments
(1 file)
For now, in order to reference some tests files, a lot of tests are either doing:
const TEST_PATH = getRootDirectory(gTestPath).replace(
"chrome://mochitests/content",
"https://example.com"
);
...
const testUrl = TEST_PATH + "test-page.html";
https://searchfox.org/mozilla-central/search?q=%22chrome%3A%2F%2Fmochitests%2Fcontent%22&path=&case=true®exp=false
(~300 tests)
Or are simply hardcoding the test URL:
const testPath =
"https://example.com/browser/browser/base/content/test/favicons/file_insecure_favicon.html";
https://searchfox.org/mozilla-central/search?q=%22https%3A%2F%2Fexample.com%2Fbrowser%2F&path=&case=true®exp=false
https://searchfox.org/mozilla-central/search?q=%22https%3A%2F%2Fexample.org%2Fbrowser&path=&case=true®exp=false
https://searchfox.org/mozilla-central/search?q=%22https%3A%2F%2Fexample.com%2Ftests%2F&path=&case=true®exp=false
(~500+50+200 tests)
There might even be some other pattern I'm not aware of.
It would be nice if it was easier to retrieve the URL of any test file.
We already have a getTestFilePath
, we would probably benefit from have a getTestFileUrl
method.
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Description
•