executionContexts.sub.html (1537B)
1 <!DOCTYPE html> 2 <html> 3 <head> 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 </head> 8 9 <body> 10 <script> 11 function createAndLoadIframe() { 12 return new Promise(resolve => { 13 addEventListener("message", function() { 14 assert_true(true, "Iframe loaded"); 15 resolve(); 16 }, { once: true }); 17 18 let ifr = document.createElement('iframe'); 19 document.body.appendChild(ifr); 20 ifr.src = get_host_info().HTTPS_REMOTE_ORIGIN + "/clear-site-data/support/iframe_executionContexts.html"; 21 }); 22 } 23 24 function loadClearSiteDataResource(what) { 25 return new Promise(resolve => { 26 addEventListener("message", function() { 27 assert_true(true, "Iframe re-loaded"); 28 resolve(); 29 }, { once: true }); 30 31 let image = new Image(); 32 image.src = get_host_info().HTTPS_REMOTE_ORIGIN + "/clear-site-data/support/echo-clear-site-data.py?" + what; 33 }); 34 } 35 36 promise_test(function(test) { 37 return createAndLoadIframe() 38 .then(() => loadClearSiteDataResource("executionContexts")) 39 }, "executionContexts triggers the reload of contexts"); 40 41 promise_test(function(test) { 42 return createAndLoadIframe() 43 .then(() => loadClearSiteDataResource("*")); 44 }, "* triggers the reload of contexts"); 45 </script> 46 </body> 47 </html>