mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 11:37:43 -10:00
Automatic update from web-platform-tests [Background Sync] Periodic Background Sync idl changes + few WPT and web_tests. Bug: 925297 Change-Id: I5c8833e236f7cf9b2993e69494ec4dc9797f7120 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660446 Commit-Queue: Mugdha Lakhani <[email protected]> Reviewed-by: Peter Beverloo <[email protected]> Reviewed-by: Mike West <[email protected]> Reviewed-by: Rayan Kanso <[email protected]> Cr-Commit-Position: refs/heads/master@{#671726} -- wpt-commits: 38ca23981b8b2227e47a497d5952503202350e38 wpt-pr: 17347
24 lines
783 B
JavaScript
24 lines
783 B
JavaScript
// META: script=/common/get-host-info.sub.js
|
|
// META: script=/service-workers/service-worker/resources/test-helpers.sub.js
|
|
|
|
'use strict'
|
|
|
|
promise_test(async test => {
|
|
const script = 'service_workers/sw.js';
|
|
const scope = 'service_workers/' + location.pathname;
|
|
|
|
const serviceWorkerRegistration =
|
|
await service_worker_unregister_and_register(test, script, scope);
|
|
|
|
assert_equals(
|
|
serviceWorkerRegistration.active, null,
|
|
'There must not be an activated worker');
|
|
|
|
await promise_rejects(
|
|
test, new DOMException('', 'InvalidStateError'),
|
|
serviceWorkerRegistration.periodicSync.register(
|
|
'test_tag'),
|
|
'register() must reject on pending and installing workers');
|
|
}, 'Periodic Background Sync requires an activated Service Worker');
|
|
|