shared-storage-writable-img-idl-attribute-included.tentative.https.sub.html (1262B)
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 t => { 14 await loadSharedStorageImage({ 15 key: 'a', value: 'b', 16 hasSharedStorageWritableAttribute: true, 17 isSameOrigin: true, 18 }); 19 20 await verifyKeyValueForOrigin('a', 'b', sameOrigin); 21 await deleteKeyForOrigin('a', sameOrigin); 22 }, 'test <img sharedstoragewritable src=[url]> via JS for same origin img'); 23 24 promise_test(async t => { 25 await loadSharedStorageImage({ 26 key: 'c', value: 'd', 27 hasSharedStorageWritableAttribute: true, 28 isSameOrigin: false, 29 }); 30 31 await verifyKeyValueForOrigin('c', 'd', crossOrigin); 32 await deleteKeyForOrigin('d', crossOrigin); 33 }, 'test <img sharedstoragewritable src=[url]> via JS for cross origin img'); 34 </script> 35 </body>