Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1298)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_worker.https.html

Issue 2365353002: Add 'WorkerGlobalScope::isSecureContext' (Closed)
Patch Set: I hate webexposed tests. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/secureContexts/resources/post-securecontext.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_worker.https.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_worker.https.html b/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_worker.https.html
new file mode 100644
index 0000000000000000000000000000000000000000..a3885bd0e9ee34d2a216ba8c8d1dff86402ffe8d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/secureContexts/authenticated_worker.https.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/get-host-info.js"></script>
+<script>
+ test(function () {
+ assert_true(window.isSecureContext);
+ }, "Sanity-check the test runner.");
+
+ async_test(t => {
+ var w = new Worker("./resources/post-securecontext.js");
+ w.onmessage = t.step_func_done(e => {
+ assert_true(e.data.isSecureContext);
+ });
+ }, "Secure workers are secure.");
+
+ async_test(t => {
+ var url = URL.createObjectURL(new Blob(['postMessage({ "isSecureContext": self.isSecureContext });']));
+ var w = new Worker(url);
+ w.onmessage = t.step_func_done(e => {
+ assert_true(e.data.isSecureContext);
+ });
+ }, "Secure workers created from 'blob:' are secure.");
+
+ async_test(t => {
+ var w = new SharedWorker("./resources/post-securecontext-shared.js");
+ w.port.onmessage = t.step_func_done(e => {
+ assert_true(e.data.isSecureContext);
+ });
+ }, "Secure shared workers are secure.");
+
+ async_test(t => {
+ var url = URL.createObjectURL(new Blob(['self.onconnect = e => { e.ports[0].postMessage({ "isSecureContext": self.isSecureContext }); };']));
+ var w = new SharedWorker(url);
+ w.port.onmessage = t.step_func_done(e => {
+ assert_true(e.data.isSecureContext);
+ });
+ }, "Secure shared workers created from 'blob:' are secure.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/security/secureContexts/resources/post-securecontext.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698