Bug 1443585 - Remove fake:true from test_pc_trackDisabling.html. r=jib
authorAndreas Pehrson <pehrsons@mozilla.com>
Tue, 06 Mar 2018 19:22:51 +0100
changeset 462025 626de98f9025f62060fd0d2871df0b911d83b75c
parent 462024 7dcf865716f8899aa2c077247f4b09a16ad08f84
child 462026 22c86b366942ea840cf844d713719efbbff5abae
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1443585
milestone60.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 1443585 - Remove fake:true from test_pc_trackDisabling.html. r=jib MozReview-Commit-ID: K8KMF7sYoul
dom/media/tests/mochitest/test_peerConnection_trackDisabling.html
--- a/dom/media/tests/mochitest/test_peerConnection_trackDisabling.html
+++ b/dom/media/tests/mochitest/test_peerConnection_trackDisabling.html
@@ -16,19 +16,17 @@ runNetworkTest(async () => {
   var test = new PeerConnectionTest();
 
   await pushPrefs(
     ["media.getusermedia.camera.stop_on_disable.enabled", true],
     ["media.getusermedia.camera.stop_on_disable.delay_ms", 0],
     ["media.getusermedia.microphone.stop_on_disable.enabled", true],
     ["media.getusermedia.microphone.stop_on_disable.delay_ms", 0]);
 
-  // Always use fake tracks since we depend on video to be somewhat green and
-  // audio to have a large 1000Hz component (or 440Hz if using fake devices).
-  test.setMediaConstraints([{audio: true, video: true, fake: true}], []);
+  test.setMediaConstraints([{audio: true, video: true}], []);
   test.chain.append([
     function CHECK_ASSUMPTIONS() {
       is(test.pcLocal.localMediaElements.length, 2,
          "pcLocal should have one media element");
       is(test.pcRemote.remoteMediaElements.length, 2,
          "pcRemote should have one media element");
       is(test.pcLocal._pc.getLocalStreams().length, 1,
          "pcLocal should have one stream");
@@ -73,21 +71,21 @@ runNetworkTest(async () => {
     },
     async function CHECK_AUDIO() {
       var ac = new AudioContext();
       var localAnalyser = new AudioStreamAnalyser(ac, test.pcLocal._pc.getLocalStreams()[0]);
       var remoteAnalyser = new AudioStreamAnalyser(ac, test.pcRemote._pc.getRemoteStreams()[0]);
 
       var checkAudio = (analyser, fun) => analyser.waitForAnalysisSuccess(fun);
 
-      var freq1k = localAnalyser.binIndexForFrequency(1000);
+      var freq = localAnalyser.binIndexForFrequency(TEST_AUDIO_FREQ);
       var checkAudioEnabled = analyser =>
-        checkAudio(analyser, array => array[freq1k] > 200);
+        checkAudio(analyser, array => array[freq] > 200);
       var checkAudioDisabled = analyser =>
-        checkAudio(analyser, array => array[freq1k] < 50);
+        checkAudio(analyser, array => array[freq] < 50);
 
       info("Checking local audio enabled");
       await checkAudioEnabled(localAnalyser);
       info("Checking remote audio enabled");
       await checkAudioEnabled(remoteAnalyser);
 
       test.pcLocal._pc.getLocalStreams()[0].getAudioTracks()[0].enabled = false;