<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
</head>
<body>
<script>
var worker;

promise_test(async (test) => {
    worker = new Worker('resources/serviceworker-in-worker.js');
    await new Promise(resolve => worker.onmessage = resolve);
    const registrations = await navigator.serviceWorker.getRegistrations();
    assert_equals(registrations.length, 1);
}, "Register service worker in worker");
</script>
</body>
</html>
