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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/secureContexts/unauthenticated_worker.html

Issue 2365353002: Add 'WorkerGlobalScope::isSecureContext' (Closed)
Patch Set: I hate webexposed tests. Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="/resources/testharness.js"></script>
3 <script src="/resources/testharnessreport.js"></script>
4 <script src="/resources/get-host-info.js"></script>
5 <script>
6 if (window.location.origin != get_host_info().UNAUTHENTICATED_ORIGIN) {
7 window.location = get_host_info().UNAUTHENTICATED_ORIGIN +
8 window.location.pathname;
9 } else {
10 test(function () {
11 assert_false(window.isSecureContext);
12 }, "Sanity-check the test runner.");
13
14 async_test(t => {
15 var w = new Worker("./resources/post-securecontext.js");
16 w.onmessage = t.step_func_done(e => {
17 assert_false(e.data.isSecureContext);
18 });
19 }, "Non-secure workers are non-secure.");
20
21 async_test(t => {
22 var url = URL.createObjectURL(new Blob(['postMessage({ "isSecureCont ext": self.isSecureContext });']));
23 var w = new Worker(url);
24 w.onmessage = t.step_func_done(e => {
25 assert_false(e.data.isSecureContext);
26 });
27 }, "Non-secure workers created from 'blob:' are non-secure.");
28
29 async_test(t => {
30 var w = new SharedWorker("./resources/post-securecontext-shared.js") ;
31 w.port.onmessage = t.step_func_done(e => {
32 assert_false(e.data.isSecureContext);
33 });
34 }, "Non-secure shared workers are non-secure.");
35
36 async_test(t => {
37 var url = URL.createObjectURL(new Blob(['self.onconnect = e => { e.p orts[0].postMessage({ "isSecureContext": self.isSecureContext }); };']));
38 var w = new SharedWorker(url);
39 w.port.onmessage = t.step_func_done(e => {
40 assert_false(e.data.isSecureContext);
41 });
42 }, "Non-secure shared workers created from 'blob:' are non-secure.");
43 }
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698