mirror of
https://github.com/servo/servo.git
synced 2025-06-25 17:44:33 +01:00
25 lines
752 B
JavaScript
25 lines
752 B
JavaScript
// META: global=window,worker
|
|
// META: script=/resources/WebIDLParser.js
|
|
// META: script=/resources/idlharness.js
|
|
// META: timeout=long
|
|
|
|
'use strict';
|
|
|
|
// https://wicg.github.io/background-fetch/
|
|
|
|
idl_test(
|
|
['background-fetch'],
|
|
['service-workers', 'html', 'dom'],
|
|
idl_array => {
|
|
const isServiceWorker = location.pathname.includes('.serviceworker.');
|
|
if (isServiceWorker) {
|
|
idl_array.add_objects({
|
|
ServiceWorkerGlobalScope: ['self'],
|
|
ServiceWorkerRegistration: ['registration'],
|
|
BackgroundFetchManager: ['registration.backgroundFetch'],
|
|
BackgroundFetchEvent: ['new BackgroundFetchEvent("type")'],
|
|
BackgroundFetchUpdateEvent: ['new BackgroundFetchUpdateEvent("type")'],
|
|
});
|
|
}
|
|
}
|
|
);
|