context.any.js (432B)
1 // META: global=window,dedicatedworker,sharedworker,serviceworker,dedicatedworker-module,sharedworker-module,serviceworker-module 2 test(t => { 3 // Test for object that's only exposed in serviceworker 4 if (self.clients) { 5 assert_true(self.isSecureContext); 6 assert_equals(location.protocol, "https:"); 7 } else { 8 assert_false(self.isSecureContext); 9 assert_equals(location.protocol, "http:"); 10 } 11 }); 12 13 done();