Bug 1208378 - Set up basic tests with muted state. r=jib
authorAndreas Pehrson <pehrsons@mozilla.com>
Tue, 07 Nov 2017 16:54:41 +0100
changeset 392787 b28d805676ddeb390b8d6a2ffdddbafca47a46f5
parent 392786 b9333a4fe45b461bfdee9cc565b2fba7bf0b728f
child 392788 a13e81bd644344b4d4d045215137ebbbf2b06793
push id97527
push usertoros@mozilla.com
push dateTue, 21 Nov 2017 10:20:05 +0000
treeherdermozilla-inbound@60d0f3ee0c43 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1208378
milestone59.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 1208378 - Set up basic tests with muted state. r=jib MozReview-Commit-ID: HUPNJnh5MWD
dom/media/tests/mochitest/head.js
--- a/dom/media/tests/mochitest/head.js
+++ b/dom/media/tests/mochitest/head.js
@@ -375,31 +375,32 @@ function runTestWhenReady(testFunc) {
         (' ' + e.stack.split('\n').join(' ... ')) : ''));
       SimpleTest.finish();
     });
 }
 
 
 /**
  * Checks that the media stream tracks have the expected amount of tracks
- * with the correct kind and id based on the type and constraints given.
+ * with the correct attributes based on the type and constraints given.
  *
  * @param {Object} constraints specifies whether the stream should have
  *                             audio, video, or both
  * @param {String} type the type of media stream tracks being checked
  * @param {sequence<MediaStreamTrack>} mediaStreamTracks the media stream
  *                                     tracks being checked
  */
 function checkMediaStreamTracksByType(constraints, type, mediaStreamTracks) {
   if (constraints[type]) {
     is(mediaStreamTracks.length, 1, 'One ' + type + ' track shall be present');
 
     if (mediaStreamTracks.length) {
       is(mediaStreamTracks[0].kind, type, 'Track kind should be ' + type);
       ok(mediaStreamTracks[0].id, 'Track id should be defined');
+      ok(!mediaStreamTracks[0].muted, 'Track should not be muted');
     }
   } else {
     is(mediaStreamTracks.length, 0, 'No ' + type + ' tracks shall be present');
   }
 }
 
 /**
  * Check that the given media stream contains the expected media stream
@@ -457,16 +458,18 @@ function checkMediaStreamTrackCloneAgain
   isnot(clone.id, original.id,
         "Track clone's id should be different from the original's");
   is(clone.kind, original.kind,
      "Track clone's kind should be same as the original's");
   is(clone.enabled, original.enabled,
      "Track clone's kind should be same as the original's");
   is(clone.readyState, original.readyState,
      "Track clone's readyState should be same as the original's");
+  is(clone.muted, original.muted,
+     "Track clone's muted state should be same as the original's");
 }
 
 /*** Utility methods */
 
 /** The dreadful setTimeout, use sparingly */
 function wait(time, message) {
   return new Promise(r => setTimeout(() => r(message), time));
 }