Bug 1408456 - convert mochitest test_audioBufferSourceNodeLazyLoopParam.html to a web-platform-test r?padenot
MozReview-Commit-ID: 5le3HWeCOby
--- 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>