Files
Mahesh Kannan 5844804a83 Bug 2070654 [wpt PR 62482] - [WebAudio] Add tests and baseline failure for unaligned looping, a=testonly
Automatic update from web-platform-tests
[WebAudio] Add tests and baseline failure for unaligned looping

This is Part 1 of a 2-part CL addressing crbug.com/553218226.

This CL introduces test coverage for looping AudioBufferSourceNodes
across boundary conditions, refactors the test suite using a factory
and generator paradigm to reduce boilerplate, and checks in the baseline
failure for unaligned buffer looping:

1. audiobuffersource-loop-continuous.html:
   WPT test covering multi-cycle looping of unaligned buffer lengths
   (65,201 frames) and grain duration boundaries.

2. audiobuffersource-loop-continuous-expected.txt:
   Captures the existing trunk failure where frame 65,200 is duplicated
   and frame 0 is skipped upon wrap.

3. AudioBufferSourceHandlerTest:
   - Refactored test fixture to AudioBufferSourceHandlerTestBase with
     shared ProcessOnAudioThread helper returning std::array.
   - Introduced CreateAudioBuffer generator helper and
     CreateEnvironmentWithBuffer factory helper, cutting boilerplate.
   - LoopOffsetBeyondLoopEndPositiveRate: Tests clamping when
     offset >= loopEnd.
   - LoopOffsetBelowLoopStartPositiveRate: Tests intro playback before
     loopStart.
   - LoopSingleSampleBuffer: Tests 1-sample buffer looping without
     division by zero.
   - LoopInvertedBoundsFallbackToWholeBuffer: Tests fallback to whole
     buffer when loopStart >= loopEnd per W3C §1.15.3.
   - LoopNegativeRateBackwardWrap: Tests backwards looping with negative
     playbackRate, including boundary wrap back to loopEnd.
   - LoopingUnalignedBufferFractionalLoopEndInterpolation: Tests
     fractional loopEnd interpolation.
   - DISABLED_LoopingUnalignedBufferPrecision: Reproduction of
     bug 553218226, to be re-enabled in Part 2.
   - DISABLED_LoopingUnalignedBufferExplicitLoopEnd: Tests explicit
     loopEnd = buffer.duration, to be re-enabled in Part 2.
   - DISABLED_LoopingGranularityWrapPrecision: Granularity matrix
     reproduction in AudioBufferSourceGranularityTest, to be
     re-enabled in Part 2.
   - DISABLED_VaryingRatesInterpolatedWrapPrecision: Rate 0.5 wrap
     reproduction, to be re-enabled in Part 2.

TAG=agy
CONV=dcf17c2a-023a-4313-a7d5-deba45eca250

Bug: 553218226
Test: external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-loop-continuous.html
Test: out/Release/blink_unittests --gtest_filter="*AudioBufferSource*"
Change-Id: I4262acd240362268b5a1dff20b8c6721e3c2d8bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8333135
Reviewed-by: Michael Wilson <mjwilson@chromium.org>
Commit-Queue: Mahesh Kannan <kmaheshb@google.com>
Cr-Commit-Position: refs/heads/main@{#1694250}

--

wpt-commits: 9eac876da93ec14a01a1633087c15d4430330013
wpt-pr: 62482
2026-09-11 14:48:45 +00:00
..

Our test suite is currently tracking the editor's draft of the Web Audio API.

The tests are arranged in subdirectories, corresponding to different sections of the spec. So, for example, tests for the DelayNode are in the-audio-api/the-delaynode-interface.