Skip to content

Commit

Permalink
Merge pull request web-platform-tests#12628 from youennf/wpt-export-f…
Browse files Browse the repository at this point in the history
…or-webkit-188842

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=188842
  • Loading branch information
youennf authored Aug 23, 2018
2 parents bbb7a37 + 0463e93 commit e570d8f
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 e570d8f

Please sign in to comment.