Bug 867089 - Test for invalid playbackRate values on an AudioBufferSourceNode. r=ehsan
authorPaul Adenot <paul@paul.cx>
Tue, 30 Apr 2013 16:04:44 +0200
changeset 130363 a0d7d78facd4d04f914d1af3fd0a50e7502a7720
parent 130362 79220f9494068ea8438eb548707138047f05ae7e
child 130364 9bc277eb06980b88cafb952ef0de1884efc3847f
push id27324
push usereakhgari@mozilla.com
push dateTue, 30 Apr 2013 18:24:14 +0000
treeherdermozilla-inbound@a0d7d78facd4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs867089
milestone23.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 867089 - Test for invalid playbackRate values on an AudioBufferSourceNode. r=ehsan
content/media/webaudio/test/Makefile.in
content/media/webaudio/test/test_bug867089.html
--- a/content/media/webaudio/test/Makefile.in
+++ b/content/media/webaudio/test/Makefile.in
@@ -14,16 +14,17 @@ MOCHITEST_FILES := \
   webaudio.js \
   test_bug808374.html \
   test_bug827541.html \
   test_bug839753.html \
   test_bug845960.html \
   test_bug856771.html \
   test_bug866570.html \
   test_bug866737.html \
+  test_bug867089.html \
   test_analyserNode.html \
   test_AudioBuffer.html \
   test_AudioContext.html \
   test_AudioListener.html \
   test_AudioParam.html \
   test_audioBufferSourceNode.html \
   test_audioBufferSourceNodeLoop.html \
   test_audioBufferSourceNodeLoopStartEnd.html \
new file mode 100644
--- /dev/null
+++ b/content/media/webaudio/test/test_bug867089.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Crashtest for bug 867089</title>
+  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
+</head>
+<body>
+<pre id="test">
+<script class="testbody" type="text/javascript">
+
+SpecialPowers.setBoolPref("media.webaudio.enabled", true);
+SimpleTest.waitForExplicitFinish();
+addLoadEvent(function() {
+  var ctx = new AudioContext();
+
+  // Test invalid playbackRate values for AudioBufferSourceNode.
+  var source = ctx.createBufferSource();
+  var buffer = ctx.createBuffer(2, 2048, 8000);
+  source.buffer = buffer;
+  source.playbackRate.value = 0.0;
+  source.connect(ctx.destination);
+  source.start(0);
+
+  var source2 = ctx.createBufferSource();
+  source2.buffer = buffer;
+  source2.playbackRate.value = -1.0;
+  source2.connect(ctx.destination);
+  source2.start(0);
+
+  var source3 = ctx.createBufferSource();
+  source3.buffer = buffer;
+  source3.playbackRate.value = 3000000.0;
+  source3.connect(ctx.destination);
+  source3.start(0);
+  ok(true, "We did not crash.");
+  SpecialPowers.clearUserPref("media.webaudio.enabled");
+  SimpleTest.finish();
+});
+
+
+</script>
+</pre>
+</body>
+</html>