Bug 1452088 [wpt PR 9927] - Implement InputDeviceInfo.getCapabilities() for audio devices, a=testonly
authorChandan Padhi <c.padhi@samsung.com>
Mon, 09 Apr 2018 14:32:34 +0000
changeset 466983 4cd655ab5f59d9e92ddf0a33162fb57b01359a6f
parent 466982 f369b0fb504c60abe7517a39b44beea609f979d5
child 466984 30dcfcdfd6d69d61113270b93ac4582c7e42a6ef
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1452088, 817769, 945590, 542312
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1452088 [wpt PR 9927] - Implement InputDeviceInfo.getCapabilities() for audio devices, a=testonly Automatic update from web-platform-testsImplement InputDeviceInfo.getCapabilities() for audio devices Bug: 817769 Change-Id: Iae2abc17aee26c5586c38412140f18fbacc66568 Reviewed-on: https://chromium-review.googlesource.com/945590 Reviewed-by: Philip J├Ągenstedt <foolip@chromium.org> Reviewed-by: Guido Urdaneta <guidou@chromium.org> Commit-Queue: Chandan Padhi <c.padhi@samsung.com> Cr-Commit-Position: refs/heads/master@{#542312} wpt-commits: ed8231137ebd32b27d48d372d7d0c898428d4d57 wpt-pr: 9927 wpt-commits: ed8231137ebd32b27d48d372d7d0c898428d4d57 wpt-pr: 9927
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -573039,17 +573039,17 @@
    "2d9b604f3039fd5bebbe0491f0bb31d5b0b47722",
    "testharness"
   ],
   "mediacapture-streams/MediaDevices-IDL-enumerateDevices.html": [
    "8382c7e6be38bad808be950b14d80fe59513ff0d",
    "testharness"
   ],
   "mediacapture-streams/MediaDevices-enumerateDevices.https.html": [
-   "98de0987027ceccd4e6164ea6afbc08d5d70c35d",
+   "1fb376d675c685d5de76fef0e840e440de3e3268",
    "testharness"
   ],
   "mediacapture-streams/MediaDevices-getUserMedia.https.html": [
    "a515deeec87c394b4a826b538df6dd0baa05cae6",
    "testharness"
   ],
   "mediacapture-streams/MediaStream-MediaElement-preload-none.https.html": [
    "374f9942ebd05d866340981469ceb28bddf83727",
--- a/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html
+++ b/testing/web-platform/tests/mediacapture-streams/MediaDevices-enumerateDevices.https.html
@@ -11,35 +11,37 @@
 <p class="instructions">This test checks for the presence of the
 <code>navigator.mediaDevices.enumerateDevices()</code> method.</p>
 <div id='log'></div>
 <script src=/resources/testharness.js></script>
 <script src=/resources/testharnessreport.js></script>
 <script>
 "use strict";
 //NOTE ALEX: for completion, a test for ondevicechange event is missing.
-test(function () {
+promise_test(function() {
   assert_true(undefined !== navigator.mediaDevices.enumerateDevices, "navigator.mediaDevices.enumerateDevices exists");
-  var p = navigator.mediaDevices.enumerateDevices()
-  p.then(function(list){
+  return navigator.mediaDevices.enumerateDevices().then(function(list) {
     for (let mediainfo of list) {
       assert_true(undefined !== mediainfo.deviceId, "mediaInfo's deviceId should exist.");
       assert_true(undefined !== mediainfo.kind,     "mediaInfo's kind     should exist.");
       assert_true(undefined !== mediainfo.label,    "mediaInfo's label    should exist.");
       assert_true(undefined !== mediainfo.groupId,  "mediaInfo's groupId  should exist.");
       // TODO the values of some of those fields should be empty string by default if no permission has been requested.
-      if ( mediainfo.kind == "audioinput" ||
-          mediainfo.kind == "videoinput") {
+      if ( mediainfo.kind == "audioinput" || mediainfo.kind == "videoinput") {
         assert_true(mediainfo instanceof InputDeviceInfo);
+        var capabilities = mediainfo.getCapabilities();
+        assert_equals(typeof capabilities, "object", "capabilities must be an object.");
+        assert_equals(typeof capabilities.deviceId, "string", "deviceId must be a string.");
+        assert_equals(typeof capabilities.groupId, "string", "groupId must be a string.");
+        if (mediainfo.kind == "audioinput") {
+          assert_equals(typeof capabilities.echoCancellation, "object", "echoCancellation must be an object.");
+        }
       } else if ( mediainfo.kind == "audiooutput" ) {
         assert_true(mediainfo instanceof MediaDeviceInfo);
       } else {
         assert_unreached("mediainfo.kind should be one of 'audioinput', 'videoinput', or 'audiooutput'.")
       }
     }
-  })
-  p.catch(function(err){
-    assert_unreached("A call to enumerateDevices() should never fail.");
   });
 }, "mediaDevices.enumerateDevices() is present and working on navigator");
 </script>
 </body>
 </html>