shared-storage-writable-iframe-idl-attribute-included.tentative.https.sub.html (1454B)
1 <!doctype html> 2 <body> 3 <script src=/resources/testharness.js></script> 4 <script src=/resources/testharnessreport.js></script> 5 <script src=/common/utils.js></script> 6 <script src=/fenced-frame/resources/utils.js></script> 7 <script src=/shared-storage/resources/util.js></script> 8 <script src=/shared-storage/resources/util.sub.js></script> 9 <script> 10 const sameOrigin = new URL("", location.href).origin; 11 const crossOrigin = 'https://{{domains[www]}}:{{ports[https][0]}}'; 12 13 promise_test(async () => { 14 await navigateSharedStorageIframe({ 15 hasSharedStorageWritableAttribute: true, 16 rawWriteHeader: "set;key=a;value=b", 17 isSameOrigin: true, 18 expectSharedStorageWritableHeader: true, 19 }); 20 await verifyKeyValueForOrigin('a', 'b', sameOrigin); 21 await deleteKeyForOrigin('a', sameOrigin); 22 }, 'test <iframe sharedstoragewritable src=[url]></iframe> via JS for' 23 + ' same origin iframe'); 24 25 promise_test(async () => { 26 await navigateSharedStorageIframe({ 27 hasSharedStorageWritableAttribute: true, 28 rawWriteHeader: "set;key=c;value=d", 29 isSameOrigin: false, 30 expectSharedStorageWritableHeader: true, 31 }); 32 await verifyKeyValueForOrigin('c', 'd', crossOrigin); 33 await deleteKeyForOrigin('c', crossOrigin); 34 }, 'test <iframe sharedstoragewritable src=[url]></iframe> via JS for' 35 + ' cross origin iframe'); 36 </script> 37 </body>