| <html manifest="resources/main-resource-redirect-with-sw.manifest"> |
| <p>Test that application cache and service worker do not mess with each other in case of redirections.</p> |
| <div id="result">Testing...</div> |
| testRunner.waitUntilDone(); |
| testRunner.setShouldDecideNavigationPolicyAfterDelay(true); |
| serviceWorkerIframe = document.createElement("iframe"); |
| serviceWorkerIframe.setAttribute("src", "/appcache/resources/register-resources-service-worker.html"); |
| document.body.appendChild(serviceWorkerIframe); |
| serviceWorkerIframe.onload = async (e) => { |
| await serviceWorkerIframe.contentWindow.registerServiceWorker(); |
| applicationCache.oncached = null; |
| applicationCache.onnoupdate = null; |
| var iframe = document.createElement("iframe"); |
| iframe.setAttribute("src", "/resources/redirect.php?url=http://127.0.0.1:8000/appcache/resources/simple.txt"); |
| document.body.appendChild(iframe); |
| applicationCache.onerror = null; |
| // We wait some small time to ensure that the frame loading does not trigger two concurrent loads. |
| window.document.body.innerHTML = "PASS"; |
| applicationCache.oncached=prepareTest; |
| applicationCache.onnoupdate=prepareTest; |