web-platform-tests / wpt

Test suites for Web platform specs — including WHATWG, W3C, and others
https://web-platform-tests.org/
Other
5k stars 3.1k forks source link

Allow standalone serviceworker tests #17339

Open jakearchibald opened 5 years ago

jakearchibald commented 5 years ago

If you want to create a test with boilerplate, it seems like you need to create a file like whatever.https.any.js, and then:

// META: global=!default,serviceworker
// …tests…

It seems a bit weird to go from .any. to "just service worker please". Should whatever.serviceworker.js imply "run this test as a service worker only"?

foolip commented 5 years ago

Perhaps all the keywords in https://web-platform-tests.org/writing-tests/testharness.html#multi-global-tests should be supported as part of the filename?

jakearchibald commented 5 years ago

Seems reasonable.

foolip commented 5 years ago

@annevk you made some pretty big changes in https://github.com/web-platform-tests/wpt/pull/6792, and I think the code that would have to be updated was added in that PR. Did you have reasons then for not supporting .serviceworker.js?

annevk commented 5 years ago

Not particularly, it was not a use case I was accounting for I suspect.

foolip commented 5 years ago

@jakearchibald do you want to give this a go? I think at the very least you'd have to do some tinkering with path_replace in ServiceWorkersHandler, and probably a bunch of other places by trial and error.

jakearchibald commented 5 years ago

I tried briefly before filing this issue and got a bit stuck, but I can give it another go.

foolip commented 5 years ago

@jakearchibald cool, please shout if it doesn't pan out, I've marked it backlog for now so that it doesn't regularly show up in triage.