isolate-and-require-corp.tentative.https.html (1147B)
1 <!doctype html> 2 <meta name="timeout" content="long"> 3 <title>Document-Isolation-Policy: isolate-and-require-corp header and subresources</title> 4 <script src=/resources/testharness.js></script> 5 <script src=/resources/testharnessreport.js></script> 6 <script src="/common/get-host-info.sub.js"></script> 7 <script src="/common/utils.js"></script> <!-- Use token() to allow running tests in parallel --> 8 <div id=log></div> 9 <script> 10 const HOST = get_host_info(); 11 const BASE = new URL("resources", location).pathname; 12 13 promise_test(async t => { 14 const response = await fetch(get_host_info().HTTPS_REMOTE_ORIGIN+"/html/document-isolation-policy/resources/nothing-cross-origin-corp.js", {mode: "no-cors"}); 15 assert_equals(response.type, "opaque"); 16 }, `"isolate-and-require-corp" top-level: fetch() to CORP: cross-origin response should succeed`); 17 18 promise_test(async t => { 19 return promise_rejects_js(t, TypeError, fetch(get_host_info().HTTPS_REMOTE_ORIGIN+"/html/document-isolation-policy/resources/nothing-no-corp.js", {mode: "no-cors"})); 20 }, `"isolate-and-require-corp" top-level: fetch() to cross-origin response without CORP should fail`); 21 22 </script>