diff --git a/webcodecs/audio-data.any.js b/webcodecs/audio-data.any.js index d5d950647767bc4..67fef3c83c858f2 100644 --- a/webcodecs/audio-data.any.js +++ b/webcodecs/audio-data.any.js @@ -192,6 +192,7 @@ const TEST_TEMPLATE = { // For each test, copy this template and replace the number by the appropriate // number for this type testInput: [MIN, BIAS, MAX, MIN, HALF, NEGATIVE_HALF, BIAS, MAX, BIAS, BIAS], + testInterleavedResult: [MIN, NEGATIVE_HALF, BIAS, BIAS, MAX, MAX, MIN, BIAS, HALF, BIAS], testVectorInterleavedResult: [ [MIN, MAX, HALF, BIAS, BIAS], [BIAS, MIN, NEGATIVE_HALF, MAX, BIAS], @@ -274,6 +275,10 @@ function get_type_values(type) { cloned.testInput, idx => TEST_VALUES[type][idx] ); + cloned.testInterleavedResult = Array.from( + cloned.testInterleavedResult, + idx => TEST_VALUES[type][idx] + ); cloned.testVectorInterleavedResult = Array.from( cloned.testVectorInterleavedResult, c => { @@ -418,7 +423,15 @@ function conversionTest(sourceType, destinationType) { "planar channel 1", assert_func ); - // Planar to interleaved isn't supported + // Copy to interleaved from planar: all channels are copied + data.copyTo(destInterleaved, {planeIndex: 0, format: destinationType}); + check_array_equality( + destInterleaved, + result.testInterleavedResult, + sourceType, + "planar to interleaved", + assert_func + ); }, `Test conversion of ${sourceType} to ${destinationType}`); }