crossorigin.html (2764B)
1 <!doctype html> 2 <html> 3 <head> 4 <title>html-script-module-crossOrigin</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 </head> 8 <body> 9 <h1>html-script-module-crossOrigin</h1> 10 <iframe id="root-WithCORS" src="crossorigin-root-same.sub.html"></iframe> 11 <iframe id="root-NoCORS" src="crossorigin-root-different.sub.html"></iframe> 12 <iframe id="root-BlockedMissingHeader" src="crossorigin-root-missingheader.sub.html"></iframe> 13 <iframe id="root-BlockedWrongHeader" src="crossorigin-root-wrongheader.sub.html"></iframe> 14 <iframe id="import-WithCORS" src="crossorigin-import-same.sub.html"></iframe> 15 <iframe id="import-NoCORS" src="crossorigin-import-different.sub.html"></iframe> 16 <iframe id="import-BlockedMissingHeader" src="crossorigin-import-missingheader.sub.html"></iframe> 17 <iframe id="import-BlockedWrongHeader" src="crossorigin-import-wrongheader.sub.html"></iframe> 18 <script> 19 20 var tests = [ 21 { "obj": async_test("Root module, Error in CORS-same-origin script"), "id": "root-WithCORS", "expected": "running,ReferenceError" }, 22 { "obj": async_test("Root module, Blocked script download, missing CORS ACAO header"), "id": "root-NoCORS", "expected": "error" }, 23 { "obj": async_test("Root module, Blocked script download, crossorigin attribute with missing CORS ACAO header"), "id": "root-BlockedMissingHeader", "expected": "error" }, 24 { "obj": async_test("Root module, Blocked script download, mismatched CORS ACAO header"), "id": "root-BlockedWrongHeader", "expected": "error" }, 25 { "obj": async_test("Imported module, Error in CORS-same-origin script"), "id": "import-WithCORS", "expected": "running,ReferenceError" }, 26 { "obj": async_test("Imported module, Blocked script download, missing CORS ACAO header"), "id": "import-NoCORS", "expected": "error" }, 27 { "obj": async_test("Imported module, Blocked script download, crossorigin attribute with missing CORS ACAO header"), "id": "import-BlockedMissingHeader", "expected": "error" }, 28 { "obj": async_test("Imported module, Blocked script download, mismatched CORS ACAO header"), "id": "import-BlockedWrongHeader", "expected": "error" }, 29 ]; 30 31 window.addEventListener("load", function () { 32 tests.forEach(function (test) { 33 var target = document.getElementById(test.id); 34 test.obj.step(function () { 35 assert_equals(target.contentDocument._log, test.expected, "Unexpected _log value"); 36 }); 37 test.obj.done(); 38 }); 39 }); 40 41 </script> 42 </body> 43 </html>