https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 0170725516779932430e2781765e844a13cd1914 authored by Ms2ger on 29 June 2018, 08:16:04 UTC
Fix make_hosts_file tests in python 3.
Tip revision: 0170725
idlharness.html
<!DOCTYPE html>
<html>
<head>
  <meta charset=utf-8>
  <title>Media Capture from DOM Elements IDL test</title>
  <link rel="help" href="https://w3c.github.io/mediacapture-fromelement/">
  <script src="/resources/testharness.js"></script>
  <script src="/resources/testharnessreport.js"></script>
  <script src="/resources/WebIDLParser.js"></script>
  <script src="/resources/idlharness.js"></script>
</head>
<body>
  <media id='media' width=10 height=10/>
  <canvas id='canvas' width=10 height=10/>

  <script>
    'use strict';

    promise_test(async () => {
      const srcs = ['mediacapture-fromelement', 'mediacapture-main', 'html', 'dom'];
      const [idl, main, html, dom] = await Promise.all(
        srcs.map(i => fetch(`/interfaces/${i}.idl`).then(r => r.text())));

      var idl_array = new IdlArray();
      idl_array.add_idls(idl);
      idl_array.add_dependency_idls(main);
      idl_array.add_dependency_idls(html);
      idl_array.add_dependency_idls(dom);
      idl_array.add_objects({
          HTMLMediaElement: ['document.getElementById("media")'],
          HTMLCanvasElement: ['document.getElementById("canvas")'],
          CanvasCaptureMediaStreamTrack: ['canvas.captureStream().getTracks()[0]'],
        });
      idl_array.test();
    }, 'Test mediacapture-fromelement IDL interfaces');
  </script>
  <div id="log"></div>
</body>
</html>
back to top