summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/mediacapture-image/idlharness.window.js
blob: 2977138647b11c5c9a48b779ec2a9f8507221b46 (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: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
// META: timeout=long

// https://w3c.github.io/mediacapture-image/

'use strict';

idl_test(
  ['image-capture'],
  ['mediacapture-streams', 'html', 'dom'],
  idl_array => {
    idl_array.add_objects({
      ImageCapture : ['capture'],
    });

    const canvas = document.createElement('canvas');
    document.body.appendChild(canvas);
    const context = canvas.getContext("2d");
    context.fillStyle = "red";
    context.fillRect(0, 0, 10, 10);
    const track = canvas.captureStream().getVideoTracks()[0];
    self.capture = new ImageCapture(track);
  }
);