Bug 1424271 - convert mochitest test_audioBufferSourceNodeLazyLoopParam.html to a web-platform-test r?padenot draft
authorp1509425
Fri, 05 Jan 2018 11:48:01 +0100
changeset 717077 6373b210ab6faf6e99e64d5df4efb1d8f23baf50
parent 717076 27e9d61fc53d0abea1f4ad1c003d1e690692284b
child 717078 0a3235713389d527fcb77b8efa3ea13c6a8ddf79
push id94557
push userbmo:alan.guyoch@gmail.com
push dateMon, 08 Jan 2018 07:50:18 +0000
reviewerspadenot
bugs1424271
milestone59.0a1
Bug 1424271 - convert mochitest test_audioBufferSourceNodeLazyLoopParam.html to a web-platform-test r?padenot MozReview-Commit-ID: 5le3HWeCOby
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/test_audioBufferSourceNodeLazyLoopParam.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -348546,16 +348546,22 @@
     ]
    ],
    "webaudio/the-audio-api/the-audiobuffersourcenode-interface/test_audioBufferSourceNodeEnded.html": [
     [
      "/webaudio/the-audio-api/the-audiobuffersourcenode-interface/test_audioBufferSourceNodeEnded.html",
      {}
     ]
    ],
+   "webaudio/the-audio-api/the-audiobuffersourcenode-interface/test_audioBufferSourceNodeLazyLoopParam.html": [
+    [
+     "/webaudio/the-audio-api/the-audiobuffersourcenode-interface/test_audioBufferSourceNodeLazyLoopParam.html",
+     {}
+    ]
+   ],
    "webaudio/the-audio-api/the-audiodestinationnode-interface/idl-test.html": [
     [
      "/webaudio/the-audio-api/the-audiodestinationnode-interface/idl-test.html",
      {}
     ]
    ],
    "webaudio/the-audio-api/the-audionode-interface/audionode-connect-return-value.html": [
     [
@@ -576443,16 +576449,20 @@
   "webaudio/the-audio-api/the-audiobuffersourcenode-interface/.gitkeep": [
    "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "support"
   ],
   "webaudio/the-audio-api/the-audiobuffersourcenode-interface/test_audioBufferSourceNodeEnded.html": [
    "f1d4dfeb26352f92bf685556049aa3b4d6a11501",
    "testharness"
   ],
+  "webaudio/the-audio-api/the-audiobuffersourcenode-interface/test_audioBufferSourceNodeLazyLoopParam.html": [
+   "5ac3d042f02eea9ccd49c4985162b8f147f161e3",
+   "testharness"
+  ],
   "webaudio/the-audio-api/the-audiocontext-interface/.gitkeep": [
    "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "support"
   ],
   "webaudio/the-audio-api/the-audiodestinationnode-interface/.gitkeep": [
    "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "support"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/webaudio/the-audio-api/the-audiobuffersourcenode-interface/test_audioBufferSourceNodeLazyLoopParam.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta charset="utf-8">
+  <script src="/resources/testharness.js"></script>
+  <script src="/resources/testharnessreport.js"></script>
+  <script src="/webaudio/js/helpers.js"></script>
+
+  <script>
+var gTest = {
+  length: 4096,
+  numberOfChannels: 1,
+  createGraph: function(context) {
+    // silence for half of the buffer, ones after that.
+    var buffer = context.createBuffer(1, 2048, context.sampleRate);
+    for (var i = 1024; i < 2048; i++) {
+      buffer.getChannelData(0)[i] = 1;
+    }
+
+    var source = context.createBufferSource();
+
+    // we start at the 1024 frames, we should only have ones.
+    source.loop = true;
+    source.loopStart = 1024 / context.sampleRate;
+    source.loopEnd = 2048 / context.sampleRate;
+    source.buffer = buffer;
+    source.start(0, 1024 / context.sampleRate, 1024 / context.sampleRate);
+    return source;
+  },
+  createExpectedBuffers: function(context) {
+    var expectedBuffer = context.createBuffer(1, 4096, context.sampleRate);
+    for (var i = 0; i < 4096; i++) {
+      expectedBuffer.getChannelData(0)[i] = 1;
+    }
+    return expectedBuffer;
+  }
+};
+
+runTest();
+  </script>
+</head>
+</body>
+</html>