Bug 1258143 - Test that MediaStream is the primary interface of a getUserMedia-stream. r=jib
authorAndreas Pehrson <apehrson@mozilla.com>
Mon, 15 Oct 2018 08:18:09 +0000
changeset 499756 92b4fac6ea6c74a9292a21fd086fa35f76c8ba92
parent 499755 9508a03be7c2ed82678cf62b0ba5356826738e9b
child 499757 f9cf33c52739b06905c182b286fa2b4d1b0f3890
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1258143
milestone64.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 1258143 - Test that MediaStream is the primary interface of a getUserMedia-stream. r=jib Differential Revision: https://phabricator.services.mozilla.com/D8376
testing/web-platform/tests/mediacapture-streams/idlharness.https.window.js
--- a/testing/web-platform/tests/mediacapture-streams/idlharness.https.window.js
+++ b/testing/web-platform/tests/mediacapture-streams/idlharness.https.window.js
@@ -29,32 +29,32 @@ promise_test(async () => {
         media = item;
       default:
         assert_unreached(
           'media.kind should be one of "audioinput", "videoinput", or "audiooutput".');
       }
     }
   } catch (e) {}
 
-  let track, trackEvent;
+  let stream, track, trackEvent;
   try {
-    const stream = await navigator.mediaDevices.getUserMedia({audio: true});
+    stream = await navigator.mediaDevices.getUserMedia({audio: true});
     track = stream.getTracks()[0];
     trackEvent = new MediaStreamTrackEvent("type", {
       track: track,
     });
   } catch (e) { throw e}
 
   if (input) {
     idl_array.add_objects({ InputDeviceInfo: [input] });
   } else {
     idl_array.add_objects({ MediaDeviceInfo: [media] });
   }
   idl_array.add_objects({
-    MediaStream: ['new MediaStream()'],
+    MediaStream: [stream, 'new MediaStream()'],
     Navigator: ['navigator'],
     MediaDevices: ['navigator.mediaDevices'],
     MediaStreamTrack: [track],
     MediaStreamTrackEvent: [trackEvent],
     OverconstrainedErrorEvent: ['new OverconstrainedErrorEvent("type", {})'],
   });
   idl_array.test();
 }, 'mediacapture-streams interfaces.');