Backed out changeset 99d7aacbdd3b (bug 916285)
authorPaul Adenot <paul@paul.cx>
Mon, 05 Jan 2015 16:04:33 +0100
changeset 222022 12b91d597b5496472458e4512cf7c46d5e5573c0
parent 222021 58388db74dfb980c419f762d98ad444e573b1524
child 222023 7978b241bf5ee96d2291fbd85506b9c034a556d5
push id53494
push userpaul@paul.cx
push dateMon, 05 Jan 2015 15:06:29 +0000
treeherdermozilla-inbound@9d72b8315f65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs916285
milestone37.0a1
backs out99d7aacbdd3b5cd96585ae4062f49c4d5e3f82be
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
Backed out changeset 99d7aacbdd3b (bug 916285)
dom/media/webaudio/OscillatorNode.cpp
dom/media/webaudio/test/mochitest.ini
dom/media/webaudio/test/test_oscillatorNodeNegativeFrequency.html
--- a/dom/media/webaudio/OscillatorNode.cpp
+++ b/dom/media/webaudio/OscillatorNode.cpp
@@ -137,20 +137,18 @@ public:
                "PeriodicWave should have sent two channels");
     mPeriodicWave = WebCore::PeriodicWave::create(mSource->SampleRate(),
     mCustom->GetData(0), mCustom->GetData(1), mCustomLength);
   }
 
   void IncrementPhase()
   {
     mPhase += mPhaseIncrement;
-    if (mPhase > 2 * M_PI) {
-      mPhase -= 2 * M_PI;
-    } else if (mPhase < -2 * M_PI) {
-      mPhase += 2 * M_PI;
+    if (mPhase > mPhaseWrap) {
+      mPhase -= mPhaseWrap;
     }
   }
 
   void UpdateParametersIfNeeded(StreamTime ticks, size_t count)
   {
     double frequency, detune;
 
     // Shortcut if frequency-related AudioParam are not automated, and we
--- a/dom/media/webaudio/test/mochitest.ini
+++ b/dom/media/webaudio/test/mochitest.ini
@@ -121,17 +121,16 @@ skip-if = android_version == '10' # bug 
 [test_mozaudiochannel.html]
 skip-if = (toolkit == 'gonk' && !debug)
 [test_nodeToParamConnection.html]
 [test_OfflineAudioContext.html]
 [test_offlineDestinationChannelCountLess.html]
 [test_offlineDestinationChannelCountMore.html]
 [test_oscillatorNode.html]
 [test_oscillatorNode2.html]
-[test_oscillatorNodeNegativeFrequency.html]
 [test_oscillatorNodePassThrough.html]
 [test_oscillatorNodeStart.html]
 [test_oscillatorTypeChange.html]
 [test_pannerNode.html]
 [test_pannerNode_equalPower.html]
 [test_pannerNodeAbove.html]
 [test_pannerNodeChannelCount.html]
 [test_pannerNodeHRTFSymmetry.html]
deleted file mode 100644
--- a/dom/media/webaudio/test/test_oscillatorNodeNegativeFrequency.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <title>Test the OscillatorNode when the frequency is negative</title>
-  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <script type="text/javascript" src="webaudio.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-SimpleTest.waitForExplicitFinish();
-addLoadEvent(function() {
-
-  var types = ["sine",
-               "square",
-               "sawtooth",
-               "triangle"];
-
-  var finished = 0;
-  function finish() {
-    if (++finished == types.length) {
-      SimpleTest.finish();
-    }
-  }
-
-  types.forEach(function(t) {
-    var context = new OfflineAudioContext(1, 256, 44100);
-    var osc = context.createOscillator();
-
-    osc.frequency.value = -440;
-    osc.type = t;
-
-    osc.connect(context.destination);
-    osc.start();
-    context.startRendering().then(function(buffer) {
-      var samples = buffer.getChannelData(0);
-      // This samples the wave form in the middle of the first period, the value
-      // should be negative.
-      ok(samples[Math.floor(44100 / 440 / 4)] < 0., "Phase should be inverted when using a " + t + " waveform");
-      finish();
-    });
-  });
-});
-
-</script>
-</pre>
-</body>
-</html>