blob: d0a64cb011a3052e23407e4863c29fc49c20b07e [file] [log] [blame]
<html>
<head>
<title>Service Worker navigation timing request and response time</title>
</head>
<body onload="doTest()">
<script>
async function doTest()
{
var registration = await navigator.serviceWorker.register("navigation-timing.js", { scope : "resources/" });
var activeWorker = registration.active;
if (!activeWorker) {
activeWorker = registration.installing;
await new Promise(resolve => {
activeWorker.addEventListener('statechange', () => {
if (activeWorker.state === "activated")
resolve(registration);
});
});
}
window.location = "resources/navigation-timing-part-2.html";
}
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
</script>
</body>
</html>