Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
youennf committed Aug 22, 2018
1 parent 46ab103 commit 0463e93
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>Service Worker: isSecureContext</title>
</head>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/test-helpers.sub.js"></script>
<script>
'use strict';

promise_test(async (t) => {
var url = 'isSecureContext.serviceworker.js';
var scope = 'empty.html';
var frame_sw, sw_registration;

await service_worker_unregister(t, scope);
var f = await with_iframe(scope);
t.add_cleanup(function() {
f.remove();
});
frame_sw = f.contentWindow.navigator.serviceWorker;
var registration = await navigator.serviceWorker.register(url, {scope: scope});
sw_registration = registration;
await wait_for_state(t, registration.installing, 'activated');
fetch_tests_from_worker(sw_registration.active);
}, 'Setting up tests');

</script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
importScripts("/resources/testharness.js");

test(() => {
assert_true(self.isSecureContext, true);
}, "isSecureContext");

0 comments on commit 0463e93

Please sign in to comment.