tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 236f3766fd01f67cb2677652d8f557b45dd1230e
parent 89f71077fd95c3a544507a71dd8fe4ae297a4519
Author: Michael Wilson <mjwilson@chromium.org>
Date:   Sat, 22 Nov 2025 21:11:53 +0000

Bug 2001439 [wpt PR 56151] - Update audioparam-default-value.window.js, a=testonly

Automatic update from web-platform-tests
Update audioparam-default-value.window.js

This test was written in a way that it could never pass, since it tries
to set the gain of a GainNode then check if the defaultValue, a
different read-only parameter, is equal to this value.

This test is currently failing for all browsers on wpt.fyi.

It's not completely clear to me what the original intent of the test
was.  Update it to do the following instead:

- Verify the defaultValue for GainNode.gain, as defined in the spec

- Verify the defaultValue is read-only

- Verify that setting the gain to something other than the default
  value correctly applies

These new tests all verify specified behavior, and should pass on
compliant implementations.

Change-Id: Ib6f3377d4d646ca14b5768c86eab774a44d8969e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7173150
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Commit-Queue: Michael Wilson <mjwilson@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1547996}

--

wpt-commits: afa490752b5c19d1f6471986fd7f30932956602e
wpt-pr: 56151

Diffstat:
Mtesting/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-default-value.window.js | 24++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)

diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-default-value.window.js b/testing/web-platform/tests/webaudio/the-audio-api/the-audioparam-interface/audioparam-default-value.window.js @@ -2,8 +2,24 @@ test(() => { const context = new OfflineAudioContext(1, 1, 44100); - const defaultValue = -1; - const gainNode = new GainNode(context, { gain: defaultValue }); + const gainNode = new GainNode(context); + assert_equals(gainNode.gain.defaultValue, 1, + 'GainNode.gain.defaultValue should be 1.'); +}, 'AudioParam: defaultValue attribute value'); - assert_equals(gainNode.gain.defaultValue, defaultValue, "AudioParam's defaultValue is not correct."); -}, "AudioParam's defaultValue"); +test(() => { + const context = new OfflineAudioContext(1, 1, 44100); + const gainNode = new GainNode(context); + assert_readonly(gainNode.gain, 'defaultValue'); +}, 'AudioParam: defaultValue is a read-only attribute'); + +test(() => { + const context = new OfflineAudioContext(1, 1, 44100); + const initialValue = -1; + const gainNode = new GainNode(context, { + gain: initialValue, + }); + assert_equals(gainNode.gain.value, initialValue, + 'GainNode.gain.value should be initialized to the value ' + + 'from the constructor.'); +}, 'AudioParam: value attribute is initialized correctly');