Files
firefox/testing/web-platform/tests/BackgroundSync/periodicsync.https.window.js
T
Mugdha Lakhani 08d45c7873 Bug 1561194 [wpt PR 17347] - [Background Sync] Periodic Background Sync idl, a=testonly
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
2019-07-24 13:31:04 +01:00

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');