https://github.com/web-platform-tests/wpt
Raw File
Tip revision: d0b159300ca1f376f148ff6ddb401edca03c0504 authored by Jim Evans on 16 March 2018, 14:04:52 UTC
Changing test_parent_htmldocument to use <body> tag
Tip revision: d0b1593
MediaStreamTrack-getCapabilities.https.html
<!doctype html>
<title>MediaStreamTrack GetCapabilities</title>
<p class="instructions">This test checks for the presence of audio and video properties in
<code>MediaStreamTrack.getCapabilities()</code> method.</p>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
  promise_test(() => {
  return navigator.mediaDevices.getUserMedia({audio: true, video: true})
    .then(stream => {
      var audioCapabilities = stream.getAudioTracks()[0].getCapabilities();
      var videoCapabilities = stream.getVideoTracks()[0].getCapabilities();
      assert_true(undefined !== audioCapabilities.deviceId, "MediaTrackCapabilities's deviceId should exist for an audio track.");
      assert_true(undefined !== audioCapabilities.echoCancellation, "MediaTrackCapabilities's echoCancellation should exist for an audio track.");
      assert_true(undefined !== videoCapabilities.deviceId, "MediaTrackCapabilities's deviceId should exist for a video track.");
    });
  });
</script>
back to top