<html>
<head>
<script src="resources/sw-test-pre.js"></script>
</head>
<body>
<script>
async function test()
{
    try {
        if (!window.internals) {
            log("test requires internals");
            return;
        }
        var hasRegistration = await internals.hasServiceWorkerRegistration("");
        log(hasRegistration ? "FAIL: Got registration" : "PASS: No registration");

        await navigator.serviceWorker.register("resources/service-worker-fetch-worker.js");

        var hasRegistration = await internals.hasServiceWorkerRegistration("/workers/service/resources/");
        log(hasRegistration ? "PASS: Got registration" : "FAIL: No registration");
    } catch(e) {
        log("Got exception: " + e);
    }
    finishSWTest();
}
test();
</script>
</body>
</html>
