summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/background-fetch/idlharness.https.any.js
blob: 61f517fdc7980a8b1666f6a19003cea4f3a29b34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// 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")'],
      });
    }
  }
);