test for bug 938022
authorTony Young <tony@rfw.name>
Mon, 24 Feb 2014 12:41:47 +1300
changeset 171174 8423ee98bc775bc060b249ecef057bcabbec245d
parent 171173 f6d3c2edbc6483b7932d781e6d4344619cbf46fa
child 171175 441506ef7062b9b16f08c404d392409d9cea4a4e
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
bugs938022
milestone30.0a1
test for bug 938022
content/media/webaudio/test/mochitest.ini
content/media/webaudio/test/test_bug938022.html
--- a/content/media/webaudio/test/mochitest.ini
+++ b/content/media/webaudio/test/mochitest.ini
@@ -58,16 +58,17 @@ support-files =
 [test_bug866737.html]
 [test_bug867089.html]
 [test_bug867104.html]
 [test_bug867174.html]
 [test_bug867203.html]
 [test_bug875221.html]
 [test_bug875402.html]
 [test_bug894150.html]
+[test_bug938022.html]
 [test_bug956489.html]
 [test_bug964376.html]
 [test_channelMergerNode.html]
 [test_channelMergerNodeWithVolume.html]
 [test_channelSplitterNode.html]
 [test_channelSplitterNodeWithVolume.html]
 [test_convolverNode.html]
 [test_convolverNodeChannelCount.html]
new file mode 100644
--- /dev/null
+++ b/content/media/webaudio/test/test_bug938022.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Test audio element currentTime is correct when used as media source</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">
+SimpleTest.waitForExplicitFinish();
+addLoadEvent(function() {
+  var context = new AudioContext();
+  var audio = new Audio("small-shot.ogg");
+  audio.load();
+  audio.addEventListener("loadeddata", function (e) {
+    is(this.currentTime, 0, "currentTime must be 0");
+    SimpleTest.finish();
+  });
+  audio.play();
+
+  var source = context.createMediaElementSource(audio);
+  source.connect(context.destination);
+});
+</script>
+</pre>
+</body>
+</html>