forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=188842
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
service-workers/service-worker/ServiceWorkerGlobalScope/isSecureContext.https.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
5 changes: 5 additions & 0 deletions
5
service-workers/service-worker/ServiceWorkerGlobalScope/isSecureContext.serviceworker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |