tor-browser

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

commit db426f641aad8e0d2bdab76d290ceed804298d57
parent 3ad97e6a7a455e73a67fd9d7da677a38e06db287
Author: Saqlain <2mesaqlain@gmail.com>
Date:   Wed, 15 Oct 2025 08:21:39 +0000

Bug 1993484 [wpt PR 55310] - [webaudio-testharness] Migrate audioworkletprocessor-options.https.html, a=testonly

Automatic update from web-platform-tests
[webaudio-testharness] Migrate audioworkletprocessor-options.https.html

Convert audioworkletprocessor-options.https.html from the legacy
audit.js runner to pure testharness.js

Bug: 396477778
Change-Id: I5dd0ad09638f8403a29ceefec863211a501dd53c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7002965
Reviewed-by: Hongchan Choi <hongchan@chromium.org>
Reviewed-by: Michael Wilson <mjwilson@chromium.org>
Commit-Queue: Saqlain <2mesaqlain@gmail.com>
Cr-Commit-Position: refs/heads/main@{#1527086}

--

wpt-commits: 1edd9494b207d892b1dbd8fdd675cfc531f590cf
wpt-pr: 55310

Diffstat:
Mtesting/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletprocessor-options.https.html | 95++++++++++++++++++++++++++++++++++++++++---------------------------------------
1 file changed, 48 insertions(+), 47 deletions(-)

diff --git a/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletprocessor-options.https.html b/testing/web-platform/tests/webaudio/the-audio-api/the-audioworklet-interface/audioworkletprocessor-options.https.html @@ -6,72 +6,73 @@ </title> <script src="/resources/testharness.js"></script> <script src="/resources/testharnessreport.js"></script> - <script src="/webaudio/resources/audit.js"></script> </head> <body> - <script id="layout-test-code"> - const audit = Audit.createTaskRunner(); + <script> const context = new AudioContext(); - let filePath = 'processors/option-test-processor.js'; + const filePath = 'processors/option-test-processor.js'; // Create a OptionTestProcessor and feed |processorData| to it. The // processor should echo the received data to the node's |onmessage| // handler. - audit.define('valid-processor-data', (task, should) => { - context.audioWorklet.addModule(filePath).then(() => { - let processorOptions = { - description: 'foo', - payload: [0, 1, 2, 3] - }; + promise_test(async () => { + await context.audioWorklet.addModule(filePath); + + const processorOptions = { + description: 'foo', + payload: [0, 1, 2, 3], + }; - let optionTestNode = - new AudioWorkletNode(context, 'option-test-processor', { - processorOptions: processorOptions - }); + const optionTestNode = + new AudioWorkletNode(context, 'option-test-processor', { + processorOptions: processorOptions, + }); + await new Promise((resolve) => { optionTestNode.port.onmessage = (event) => { - should(event.data.processorOptions.description, - '|description| field in processorOptions from processor("' + - event.data.processorOptions.description + '")') - .beEqualTo(processorOptions.description, - 'the field in node constructor options ("' + - processorOptions.description + '")'); - should(event.data.processorOptions.payload, - '|payload| array in processorOptions from processor([' + - event.data.processorOptions.payload + '])') - .beEqualToArray([0, 1, 2, 3], - 'the array in node constructor options ([' + - event.data.processorOptions.payload + '])'); - task.done(); + assert_equals( + event.data.processorOptions.description, + processorOptions.description, + `|description| field in processorOptions from processor(` + + `"${event.data.processorOptions.description}") vs ` + + `constructor ("${processorOptions.description}")`); + assert_array_equals( + event.data.processorOptions.payload, + processorOptions.payload, + `|payload| array in processorOptions from processor(` + + `[${event.data.processorOptions.payload}]) vs constructor` + + ` ([${processorOptions.payload}])`); + resolve(); }; }); - }); - + }, `valid-processor-data: processorOptions round-trip`); // Passing empty option dictionary should work without a problem. - audit.define('empty-option', (task, should) => { - context.audioWorklet.addModule(filePath).then(() => { - let optionTestNode = - new AudioWorkletNode(context, 'option-test-processor'); + promise_test(async () => { + await context.audioWorklet.addModule(filePath); + const optionTestNode = + new AudioWorkletNode(context, 'option-test-processor'); + + await new Promise((resolve) => { optionTestNode.port.onmessage = (event) => { - should(Object.keys(event.data).length, - 'Number of properties in data from processor') - .beEqualTo(2); - should(event.data.numberOfInputs, - '|numberOfInputs| field in data from processor') - .beEqualTo(1); - should(event.data.numberOfOutputs, - '|numberOfOutputs| field in data from processor') - .beEqualToArray(1); - task.done(); + assert_equals( + Object.keys(event.data).length, + 2, + `Number of properties in data from processor`); + assert_equals( + event.data.numberOfInputs, + 1, + `|numberOfInputs| field in data from processor`); + assert_equals( + event.data.numberOfOutputs, + 1, + `|numberOfOutputs| field in data from processor`); + resolve(); }; }); - }); - - - audit.run(); + }, `empty-option: default processorOptions behavior`); </script> </body> </html>