Back out changeset 9ebcec50fefa (bug 1223261) for causing unacceptable levels of intermittent orange (bug 1230015, bug 1230020). a=orange
authorL. David Baron <dbaron@dbaron.org>
Sat, 05 Dec 2015 15:18:32 -0800
changeset 314447 cc9c6cd756cb744596ba039dcc5ad3065a7cc3ea
parent 314430 fb4801cfdbbf072a071f6a6ef8c1cf13dd6de960
child 314448 318a476972a6e6df25e6deb1cf1cf12aeac3078c
child 314517 29e5fb8c86db75eafcc44dc607f7a00312ce0f47
child 314524 f62bbe97d76df054802581bcc59ec2799312eda4
child 314531 0aa2be7bf89908f74cf1aeaf417e55775857ea34
child 314581 9bbb66e75886cdff82c6a35a444e46f63752b54e
child 314652 57a16f6ee3e2fae4177f137263546d5e0f6c5cba
push id8215
push usersergej@codewaves.com
push dateSun, 06 Dec 2015 18:56:07 +0000
reviewersorange
bugs1223261, 1230015, 1230020
milestone45.0a1
backs out9ebcec50fefa0e7438c09f35f91a95d1dc623c00
Back out changeset 9ebcec50fefa (bug 1223261) for causing unacceptable levels of intermittent orange (bug 1230015, bug 1230020). a=orange
dom/browser-element/mochitest/browserElement_AudioChannel.js
dom/browser-element/mochitest/file_processingAudioSample.html
dom/browser-element/mochitest/mochitest.ini
--- a/dom/browser-element/mochitest/browserElement_AudioChannel.js
+++ b/dom/browser-element/mochitest/browserElement_AudioChannel.js
@@ -5,17 +5,16 @@
 
 "use strict";
 
 SimpleTest.waitForExplicitFinish();
 browserElementTestHelpers.setEnabledPref(true);
 browserElementTestHelpers.addPermission();
 
 function noaudio() {
-  info("Test : no-audio");
   var iframe = document.createElement('iframe');
   iframe.setAttribute('mozbrowser', 'true');
   iframe.setAttribute('mozapp', 'http://example.org/manifest.webapp');
   iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/file_empty.html';
 
   function noaudio_loadend() {
     ok("mute" in iframe, "iframe.mute exists");
     ok("unmute" in iframe, "iframe.unmute exists");
@@ -139,17 +138,16 @@ function noaudio() {
     .then(runTests);
   }
 
   iframe.addEventListener('mozbrowserloadend', noaudio_loadend);
   document.body.appendChild(iframe);
 }
 
 function audio() {
-  info("Test : audio");
   var iframe = document.createElement('iframe');
   iframe.setAttribute('mozbrowser', 'true');
   iframe.setAttribute('mozapp', 'http://example.org/manifest.webapp');
   iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/iframe_file_audio.html';
 
   function audio_loadend() {
     ok("mute" in iframe, "iframe.mute exists");
     ok("unmute" in iframe, "iframe.unmute exists");
@@ -176,76 +174,25 @@ function audio() {
       runTests();
     }
   }
 
   iframe.addEventListener('mozbrowserloadend', audio_loadend);
   document.body.appendChild(iframe);
 }
 
-function audioMutedByDefault() {
-  info("Test : audio-muted-by-default");
-  SpecialPowers.pushPrefEnv(
-    {'set': [["dom.audiochannel.mutedByDefault", true]]}, function () {
-      var iframe = document.createElement('iframe');
-      iframe.setAttribute('mozbrowser', 'true');
-      iframe.setAttribute('mozapp', 'http://example.org/manifest.webapp');
-      iframe.src = 'http://example.org/tests/dom/browser-element/mochitest/file_processingAudioSample.html';
-
-      function audio_loadend_MutedByDefault() {
-        ok("allowedAudioChannels" in iframe, "allowedAudioChannels exist");
-        var channels = iframe.allowedAudioChannels;
-        is(channels.length, 1, "1 audio channel by default");
-
-        var ac = channels[0];
-
-        ok(ac instanceof BrowserElementAudioChannel, "Correct class");
-        ok("getMuted" in ac, "ac.getMuted exists");
-        ok("setMuted" in ac, "ac.setMuted exists");
-
-        ac.onactivestatechanged = function() {
-          ok(true, "activestatechanged event received.");
-          ac.onactivestatechanged = null;
-
-          new Promise(function(r, rr) {
-            ac.getMuted().onsuccess = function(e) {
-              is(e.target.result, true, "Muted channel by default");
-              r();
-            }
-          })
-          .then(function() {
-            ac.setMuted(false).onsuccess = function(e) {
-              ok(true, "Unmuted the channel.");
-            }
-          })
-        }
-
-        var complete = false;
-        iframe.addEventListener("mozbrowsershowmodalprompt", function (e) {
-          is(e.detail.message, "playback-success", "Audio playback success!");
-          if (!complete) {
-            document.body.removeChild(iframe);
-            SpecialPowers.popPrefEnv(runTests);
-            complete = true;
-          }
-        });
-      }
-
-      iframe.addEventListener('mozbrowserloadend', audio_loadend_MutedByDefault);
-      document.body.appendChild(iframe);
-  });
-}
-
-var tests = [ noaudio, audio, audioMutedByDefault ];
+var tests = [ noaudio, audio ];
 
 function runTests() {
   if (tests.length == 0) {
     SimpleTest.finish();
     return;
   }
 
   var test = tests.shift();
   test();
 }
 
+
 addEventListener('load', function() {
   SimpleTest.executeSoon(runTests);
 });
+
deleted file mode 100644
--- a/dom/browser-element/mochitest/file_processingAudioSample.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<html>
-<body>
-<script>
-var audio = new Audio("audio.ogg");
-var context = new AudioContext();
-var node = context.createMediaElementSource(audio);
-var sp = context.createScriptProcessor(2048, 1);
-node.connect(sp);
-var expectedSamplesCount;
-var nonzeroSamplesCount = 0;
-var complete = false;
-var iterationCount = 0;
-
-function processSamples(e) {
-  if (complete) {
-    return;
-  }
-
-  // Start playing the audio until the AudioContext is connected and running.
-  if (iterationCount++ == 0) {
-    audio.play();
-  }
-
-  var buf = e.inputBuffer.getChannelData(0);
-  for (var i = 0; i < buf.length; ++i) {
-    if (buf[i] != 0) {
-      nonzeroSamplesCount++;
-    }
-  }
-
-  if (nonzeroSamplesCount >= expectedSamplesCount && !complete) {
-    alert("playback-success");
-    complete = true;
-  }
-}
-
-audio.oncanplaythrough = function() {
-  var testDuration = audio.duration > 2.0 ? 2.0 : audio.duration;
-  expectedSamplesCount = Math.floor(testDuration * context.sampleRate) ;
-  sp.onaudioprocess = processSamples;
-};
-
-</script>
-</body>
-</html>
--- a/dom/browser-element/mochitest/mochitest.ini
+++ b/dom/browser-element/mochitest/mochitest.ini
@@ -135,17 +135,16 @@ support-files =
   file_microformats.html
   file_post_request.html
   file_wyciwyg.html
   file_audio.html
   iframe_file_audio.html
   file_web_manifest.html
   file_web_manifest.json
   file_illegal_web_manifest.html
-  file_processingAudioSample.html
 
 # Note: browserElementTestHelpers.js looks at the test's filename to determine
 # whether the test should be OOP.  "_oop_" signals OOP, "_inproc_" signals in
 # process.  Default is OOP.
 [test_browserElement_inproc_getWebManifest.html]
 [test_browserElement_NoAttr.html]
 [test_browserElement_NoPref.html]
 [test_browserElement_NoPermission.html]