Title: [287785] trunk/LayoutTests/imported/w3c
Revision
287785
Author
[email protected]
Date
2022-01-07 14:46:16 -0800 (Fri, 07 Jan 2022)

Log Message

Resync web-platform-tests/webaudio from upstream
https://bugs.webkit.org/show_bug.cgi?id=234981

Reviewed by Geoffrey Garen.

Resync web-platform-tests/webaudio from upstream 84b2be5b17e8542dea2.

* web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content-expected.txt: Added.
* web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html: Added.
* web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/w3c-import.log:
* web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/w3c-import.log:
* web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows-expected.txt: Added.
* web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html: Added.
* web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/w3c-import.log:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (287784 => 287785)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-07 22:45:01 UTC (rev 287784)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-07 22:46:16 UTC (rev 287785)
@@ -1,3 +1,20 @@
+2022-01-07  Chris Dumez  <[email protected]>
+
+        Resync web-platform-tests/webaudio from upstream
+        https://bugs.webkit.org/show_bug.cgi?id=234981
+
+        Reviewed by Geoffrey Garen.
+
+        Resync web-platform-tests/webaudio from upstream 84b2be5b17e8542dea2.
+
+        * web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content-expected.txt: Added.
+        * web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html: Added.
+        * web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/w3c-import.log:
+        * web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/w3c-import.log:
+        * web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows-expected.txt: Added.
+        * web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html: Added.
+        * web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/w3c-import.log:
+
 2022-01-07  Antoine Quint  <[email protected]>
 
         Inserting a new @keyframes rule does not start animations that already used this name

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content-expected.txt (0 => 287785)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content-expected.txt	2022-01-07 22:46:16 UTC (rev 287785)
@@ -0,0 +1,5 @@
+
+FAIL AudioBufferSourceNode setter set with non-null buffer assert_true: Invalid value at index 0, expecte close to 1.0, found 0.5 when reading back expected true got false
+FAIL AudioBufferSourceNode buffer setter set with null assert_true: Invalid value at index 0, expecte close to 1.0, found 0.5 when reading back expected true got false
+PASS ConvolverNode
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html (0 => 287785)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html	2022-01-07 22:46:16 UTC (rev 287785)
@@ -0,0 +1,85 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>Test for AudioBuffer's "acquire the content" operation</title>
+<script src=""
+<script src=""
+<script>
+const SAMPLERATE = 8000;
+const LENGTH = 128;
+
+var tests = {
+  "AudioBufferSourceNode setter set with non-null buffer": function(oac) {
+    var buf = oac.createBuffer(1, LENGTH, SAMPLERATE)
+    var bs = new AudioBufferSourceNode(oac);
+    var channelData = buf.getChannelData(0);
+    for (var i = 0; i < channelData.length; i++) {
+      channelData[i] = 1.0;
+    }
+    bs.buffer = buf;
+    bs.start(); // This acquires the content since buf is not null
+    for (var i = 0; i < channelData.length; i++) {
+      channelData[i] = 0.5;
+    }
+    allSamplesAtOne(buf, "reading back");
+    bs.connect(oac.destination);
+    return oac.startRendering();
+  },
+  "AudioBufferSourceNode buffer setter set with null" : (oac) => {
+    var buf = oac.createBuffer(1, LENGTH, SAMPLERATE)
+    var bs = new AudioBufferSourceNode(oac);
+    var channelData = buf.getChannelData(0);
+    for (var i = 0; i < channelData.length; i++) {
+      channelData[i] = 1.0;
+    }
+    bs.buffer = null;
+    bs.start(); // This does not acquire the content
+    bs.buffer = buf; // This does
+    for (var i = 0; i < channelData.length; i++) {
+      channelData[i] = 0.5;
+    }
+    allSamplesAtOne(buf, "reading back");
+    bs.connect(oac.destination);
+    return oac.startRendering();
+  },
+  "ConvolverNode": (oac) => {
+    var buf = oac.createBuffer(1, LENGTH, SAMPLERATE)
+    var impulse = oac.createBuffer(1, 1, SAMPLERATE)
+    var bs = new AudioBufferSourceNode(oac);
+    var convolver = new ConvolverNode(oac, {disableNormalization: true});
+
+    impulse.getChannelData(0)[0] = 1.0; // unit impulse function
+    convolver.buffer = impulse; // This does acquire the content
+    impulse.getChannelData(0)[0] = 0.5;
+
+    var channelData = buf.getChannelData(0);
+    for (var i = 0; i < channelData.length; i++) {
+      channelData[i] = 1.0;
+    }
+    bs.buffer = buf;
+    bs.start();
+
+    bs.connect(convolver).connect(oac.destination);
+    return oac.startRendering();
+  }
+};
+
+function allSamplesAtOne(audiobuffer, location) {
+  var buf = audiobuffer.getChannelData(0);
+  for (var i = 0; i < buf.length; i++) {
+    // The convolver can introduce a slight numerical error.
+    if (Math.abs(buf[i] - 1.0) > 0.0001) {
+      assert_true(false, `Invalid value at index ${i}, expecte close to 1.0, found ${buf[i]} when ${location}`)
+      return Promise.reject();
+    }
+  }
+  assert_true(true, `Buffer unmodified when ${location}.`);
+  return Promise.resolve();
+}
+
+for (const test of Object.keys(tests)) {
+  promise_test(async function(t) {
+    var buf = await tests[test](new OfflineAudioContext(1, LENGTH, SAMPLERATE));
+    return allSamplesAtOne(buf, "rendering");
+  }, test);
+};
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/w3c-import.log (287784 => 287785)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/w3c-import.log	2022-01-07 22:45:01 UTC (rev 287784)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/w3c-import.log	2022-01-07 22:46:16 UTC (rev 287785)
@@ -14,6 +14,7 @@
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/acquire-the-content.html
 /LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-copy-channel.html
 /LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-getChannelData.html
 /LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiobuffer-interface/audiobuffer-reuse.html

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/w3c-import.log (287784 => 287785)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/w3c-import.log	2022-01-07 22:45:01 UTC (rev 287784)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/w3c-import.log	2022-01-07 22:46:16 UTC (rev 287785)
@@ -15,6 +15,7 @@
 ------------------------------------------------------------------------
 List of files:
 /LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-detached-execution-context.html
+/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-getoutputtimestamp-cross-realm.html
 /LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-getoutputtimestamp.html
 /LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-not-fully-active.html
 /LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-suspend-resume.html

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows-expected.txt (0 => 287785)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows-expected.txt	2022-01-07 22:46:16 UTC (rev 287785)
@@ -0,0 +1,4 @@
+
+PASS createPeriodicWave with Infinity real values should throw
+PASS createPeriodicWave with Infinity imag values should throw
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html (0 => 287785)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html	2022-01-07 22:46:16 UTC (rev 287785)
@@ -0,0 +1,22 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test AudioContext.createPeriodicWave when inputs contain Infinite values</title>
+<script src=""
+<script src=""
+<script>
+let ctx;
+setup(() => {
+  ctx = new OfflineAudioContext({length: 1, sampleRate: 24000});
+});
+test(() => {
+  const real = new Float32Array([0, Infinity]);
+  const imag = new Float32Array([0, 1]);
+  assert_throws_js(TypeError, () => ctx.createPeriodicWave(real, imag));
+}, "createPeriodicWave with Infinity real values should throw");
+
+test(() => {
+  const real = new Float32Array([0, 1]);
+  const imag = new Float32Array([1, Infinity]);
+  assert_throws_js(TypeError, () => ctx.createPeriodicWave(real, imag));
+}, "createPeriodicWave with Infinity imag values should throw");
+</script>

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/w3c-import.log (287784 => 287785)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/w3c-import.log	2022-01-07 22:45:01 UTC (rev 287784)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/w3c-import.log	2022-01-07 22:46:16 UTC (rev 287785)
@@ -14,4 +14,5 @@
 None
 ------------------------------------------------------------------------
 List of files:
+/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/createPeriodicWaveInfiniteValuesThrows.html
 /LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-periodicwave-interface/periodicWave.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to