<!doctype html><html><head><metacharset="utf-8"><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script><scriptsrc="/common/get-host-info.sub.js"></script><scriptsrc="/common/utils.js"></script></head><body><divid="testDiv"></div><script>constscriptURL=get_host_info().HTTP_REMOTE_ORIGIN+"/cors/resources/cache-304.py?"+token();functionloadScript(test){constscript=document.createElement("script");script.crossOrigin="anonymous";script.src=scriptURL;returnnewPromise((resolve,reject)=>{// Let's add a small timeout so that the script is fully loaded in memory cache before reloading it.script.onload=test.step_timeout(resolve,50);script.onerror=reject;testDiv.appendChild(script);});}promise_test((test)=>{returnloadScript(test);},"Load a fresh cross-origin script");promise_test((test)=>{returnloadScript(test);},"Reload same cross-origin script from the memory cache after revalidation");</script></body></html>