blob: 8c5a39bbdea29cdee8fc4f0ef5228aa94a5a0962 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Service Worker: Fetch API CORS preflight tests</title>
</head>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/service-workers/service-worker/resources/test-helpers.sub.js"></script>
<script>
'use strict';
// FIXME: Remove this test once https://github.com/w3c/web-platform-tests/issues/4210 is resolved.
promise_test(async (t) => {
var url = 'cors-preflight-star.any.worker.js';
var scope = 'empty.html';
var frame_sw, sw_registration;
await service_worker_unregister(t, scope);
var f = await with_iframe(scope);
t.add_cleanup(function() {
f.remove();
});
frame_sw = f.contentWindow.navigator.serviceWorker;
var registration = await navigator.serviceWorker.register(url, {scope: scope});
sw_registration = registration;
await wait_for_state(t, registration.installing, 'activated');
fetch_tests_from_worker(sw_registration.active);
}, 'Setting up tests');
</script>
</body>
</html>