Bug 1408456 - convert mochitest test_audioBufferSourceNodeLazyLoopParam.html to a web-platform-test r?padenot draft
authorp1509425
Fri, 05 Jan 2018 11:48:01 +0100
changeset 716245 79f78b7a8c246ad756200a94c704590b0e8c6b9b
parent 716244 a3af073f6887a198418d2b044c2e105cd061e388
child 716246 215308aecad4ea9efd8113e48458ccc542f140e7
push id94371
push userbmo:alan.guyoch@gmail.com
push dateFri, 05 Jan 2018 10:49:07 +0000
reviewerspadenot
bugs1408456
milestone59.0a1
Bug 1408456 - 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>