initial-empty-document.tentative.https.window.js (1363B)
1 // META: script=/common/get-host-info.sub.js 2 // META: script=/html/cross-origin-embedder-policy/credentialless/resources/common.js 3 4 const {ORIGIN} = get_host_info(); 5 6 promise_test_parallel(async t => { 7 const parent = document.createElement("iframe"); 8 parent.credentialless = true; 9 document.body.appendChild(parent); 10 parent.src = ORIGIN + "/common/blank.html"; 11 // Wait for navigation to complete. 12 await new Promise(resolve => parent.onload = resolve); 13 assert_true(parent.credentialless); 14 15 const child = document.createElement("iframe"); 16 parent.contentDocument.body.appendChild(child); 17 assert_false(child.credentialless); 18 assert_true(child.contentWindow.credentialless); 19 }, "Initial empty document inherits from parent's document."); 20 21 promise_test_parallel(async t => { 22 const parent = document.createElement("iframe"); 23 document.body.appendChild(parent); 24 parent.src = ORIGIN + "/common/blank.html"; 25 // Wait for navigation to complete. 26 await new Promise(resolve => parent.onload = resolve); 27 assert_false(parent.credentialless); 28 29 const child = document.createElement("iframe"); 30 child.credentialless = true; 31 parent.contentDocument.body.appendChild(child); 32 assert_true(child.credentialless); 33 assert_true(child.contentWindow.credentialless); 34 }, "Initial empty document inherits from its's iframe's credentialless attribute.");