summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/requestidlecallback/idlharness.window.js
blob: 69cd5a49b0432a65db9da267248a6f97d93cd0b9 (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
// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js

// https://w3c.github.io/requestidlecallback/

'use strict';

idl_test(
  ['requestidlecallback'],
  ['html', 'dom'],
  async idl_array => {
    idl_array.add_objects({
      IdleDeadline: ['deadline'],
      Window: ['window'],
    });

    await new Promise(resolve => {
      requestIdleCallback(d => {
        self.deadline = d;
        resolve();
      }, { timeout: 100 });
    });
  }
);