Closed Bug 2055432 Opened 7 days ago Closed 1 day ago

[wpt-sync] Sync PR 61327 - [WebAudio] Implement AudioWorkletNode lifetime fix (part 2 of 2)

Categories

(Core :: Web Audio, task, P4)

task

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 61327 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/61327
Details from upstream follow.

Mahesh Bharadwaj Kannan <kmaheshb@google.com> wrote:

[WebAudio] Implement AudioWorkletNode lifetime fix (part 2 of 2)

This CL implements the spec-compliant lifetime logic for
AudioWorkletNode.

Specifically:

  • We track the active source flag of the processor.
  • In AudioWorkletHandler::Process(), we check if there are active
    connected inputs. If the active source flag is false and there are no
    active inputs, we terminate the processor early and skip JS execution.
  • We resolve a thread-safety hazard by pre-binding a WeakPtr to the
    handler on the main thread and copying it on the audio thread.
  • We refactor the cleanup and input connection checks into private
    helpers for better readability and style.
  • We pass nullptr to inputs when they are disconnected to remain spec-
    compliant (0 channels in JS).
  • We fix a boundary-stopping delay in AudioScheduledSourceHandler to
    ensure source nodes finish immediately when scheduled to stop on a
    quantum boundary, resolving a 1-quantum lag in downstream
    disconnection.
  • We fix a DCHECK failure in AudioScheduledSourceHandler by restricting
    zeroing to strictly less than quantum end.
  • We make the zero-output-processor.js test processor robust against
    0-channel inputs when disconnected.
  • We remove the expected failure baseline for the WPT test as it now
    passes completely.

Bug: 41435286
Test: third_party/blink/web_tests/external/wpt/webaudio/the-audio-api/the-audioworklet-interface/audioworkletnode-lifetime.https.html
Change-Id: I6499feddbb119c3220781bfd8561dc241ffcf37b
Reviewed-on: https://chromium-review.googlesource.com/8093149
WPT-Export-Revision: 38e281751e240957c90a1f99c2a940dceddb5cb8

Component: web-platform-tests → Web Audio
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 39 tests and 3 subtests

Status Summary

Firefox

OK : 1[GitHub] 32[Gecko-android-em-14-x86_64-debug-geckoview] 36[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 37[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 8[GitHub] 136[Gecko-android-em-14-x86_64-debug-geckoview] 149[Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview] 157[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 21

Chrome

OK : 1
PASS: 8

Safari

OK : 1
PASS: 8

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
You need to log in before you can comment on or make changes to this bug.