Bug 873553 - Part 11: Run the Web Audio tests with two OfflineAudioContexts, one at 48KHz and one at 44.1KHz; r=roc
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 24 May 2013 13:11:53 -0400
changeset 132931 670d867ff3bafba4b049ca633417d6ad5177acaa
parent 132930 976545bf713e1438833a544efe4b91f308d8e5f2
child 132932 ebb4eec0258db44d10337f167bce65914a3247ce
push id24727
push userphilringnalda@gmail.com
push dateSun, 26 May 2013 04:02:45 +0000
treeherdermozilla-central@0fed3377c839 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs873553
milestone24.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 873553 - Part 11: Run the Web Audio tests with two OfflineAudioContexts, one at 48KHz and one at 44.1KHz; r=roc
content/media/webaudio/test/webaudio.js
--- a/content/media/webaudio/test/webaudio.js
+++ b/content/media/webaudio/test/webaudio.js
@@ -151,17 +151,17 @@ function runTest()
             callback();
           }
         };
       }
       var context = new AudioContext();
       runTestOnContext(context, callback, testOutput);
     }
 
-    function testOnOfflineContext(callback) {
+    function testOnOfflineContext(callback, sampleRate) {
       function testOutput(nodeToInspect, expectedBuffers, callback) {
         nodeToInspect.connect(context.destination);
         context.oncomplete = function(e) {
           var samplesSeen = 0;
           while (expectedBuffers.length) {
             var expectedBuffer = expectedBuffers.shift();
             is(e.renderedBuffer.numberOfChannels, expectedBuffer.numberOfChannels,
                "Correct number of input buffer channels");
@@ -175,17 +175,19 @@ function runTest()
                              true);
             }
             samplesSeen += expectedBuffer.length;
           }
           callback();
         };
         context.startRendering();
       }
-      var context = new OfflineAudioContext(gTest.numberOfChannels, testLength, 48000);
+      var context = new OfflineAudioContext(gTest.numberOfChannels, testLength, sampleRate);
       runTestOnContext(context, callback, testOutput);
     }
 
     testOnNormalContext(function() {
-      testOnOfflineContext(done);
+      testOnOfflineContext(function() {
+        testOnOfflineContext(done, 44100);
+      }, 48000);
     });
   });
 }