Bug 1258143 - Test that MediaStream is the primary interface of a getUserMedia-stream. r=jib
☠☠ backed out by 2fe9ae645046 ☠ ☠
authorAndreas Pehrson <apehrson@mozilla.com>
Thu, 11 Oct 2018 15:49:52 +0000
changeset 489318 514420f15a67df92c218191b23a3b4bcd4b7ea95
parent 489317 905c871bcf0366ad037e4409ce21afe2a2fba440
child 489319 bb8d7ab5e55fea5d8a962b59364d35eb955d8d94
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersjib
bugs1258143
milestone64.0a1
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.');