Files
firefox/testing/web-platform/tests/infrastructure/server/secure-context.https.any.js
T
moz-wptsync-bot 692f42fe70 Bug 1482160 [wpt PR 12381] - Fix service worker tests generated from non-https .any.js, a=testonly
Automatic update from web-platform-testsFix service worker tests generated from non-https .any.js

Note: this contains a change to the expected behaviour of test
runners.

Previously .any.js tests specifying a serviceworker variant generated
a url like foo.https.any.serviceworker.html. But that causes a problem
because that looks exctly like a url generated from a file named
foo.https.js. This ambiguity, together with the fact that wptrunner
wasn't actually looking at the https flag in the test id, but only in
the filename, meant that service worker tests weren't being run
properly.

This change stops adding .https. to serviceworker tests generated from
.any.js files and instead makes .serviceworker. in the test id
directly mean that the test should be loaded over https.

--

wpt-commits: bfec5399443c15c7a201a3d2b5505967433f570c
wpt-pr: 12381
2018-08-15 16:50:28 +00:00

11 lines
301 B
JavaScript

// META: global=window,dedicatedworker,sharedworker,serviceworker
test(() => {
assert_true(self.isSecureContext);
}, "Use of .https file name flag implies secure context");
test(() => {
assert_equals(location.protocol, "https:");
}, "Use of .https file name flag implies HTTPS scheme");
done();