Open Bug 1338070 Opened 3 years ago Updated 3 years ago

I can't seem to be able to create a *.any.js file that ends up with substitutions in the usual something.sub.html way


(Testing :: web-platform-tests, defect)

Not set


(Not tracked)


(Reporter: bzbarsky, Unassigned)


I tried creating a test that uses the any.js infrastructure but gets substitutions via the normal .sub.something stuff.

If I try calling the new test html/dom/self-origin.any.sub.js, I get an error during manifest update:

  File "testing/web-platform/tests/tools/manifest/", line 467, in manifest_items
    TestharnessTest(self, replace_end(self.url, ".any.js", ".any.html")),
  File "testing/web-platform/tests/tools/manifest/", line 29, in replace_end
    assert s.endswith(old)

If I try calling it html/dom/self-origin.any.sub.js, the manifest is updated properly and we thing we have html/dom/self-origin.sub.any.html and html/dom/self-origin.sub.any.worker.html tests.

However, if I run the html/dom/self-origin.sub.any.html test, it loads /html/dom/self-origin.sub.any.js which doesn't get substitutions performed on it.  not surprising, since afaict our harness only does substitutions on things ending with .sub.someext, and this filename doesn't.
Flags: needinfo?(james)
I guess it's not terribly surprising that the code gets more brittle as we combine more features into the file name :/

Something like this could work after the next wpt sync:

Still, it's probably worth checking how much work it'd be to make this work.
I think maybe we can move the .sub. handling out of the file handler and put it later in the pipeline, just before the content is sent over the wire. I'll investigate.
I have a PR up to make .sub.any.js work:
Flags: needinfo?(james)
You need to log in before you can comment on or make changes to this bug.