[Webkit-unassigned] [Bug 247751] Return after throwing an exception when ConvolerNode.buffer rate is wrong

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 14 07:40:59 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=247751

Chris Dumez <cdumez at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |CONFIGURATION CHANGED

--- Comment #4 from Chris Dumez <cdumez at apple.com> ---
If you look at the test that Blink added in LayoutTests/webaudio/dom-exceptions.html, you'll see that we also have it:
```
      audit.define('convolver', (task, should) => {
        // Convolver buffer rate must match context rate. Create on offline
        // context so we specify the context rate exactly, in case the test is
        // run on platforms with different HW sample rates.
        let oc;

        should(
            () => oc = new OfflineAudioContext(1, 44100, 44100),
            'oc = new OfflineAudioContext(1, 44100, 44100)')
            .notThrow();
        should(() => conv = oc.createConvolver(), 'conv = oc.createConvolver()')
            .notThrow();
        should(() => conv.buffer = {}, 'conv.buffer = {}').throw();
        should(
            () => conv.buffer = oc.createBuffer(1, 100, 22050),
            'conv.buffer = oc.createBuffer(1, 100, 22050)')
            .throw();
        // conv.buffer should be unchanged (null) because the above failed.
        should(conv.buffer, 'conv.buffer').beEqualTo(null); // THIS CHECK HERE

        task.done();
      });
```

and that we are passing it:
```
PASS > [convolver]
PASS   oc = new OfflineAudioContext(1, 44100, 44100) did not throw an exception.
PASS   conv = oc.createConvolver() did not throw an exception.
PASS   conv.buffer = {} threw TypeError: "The ConvolverNode.buffer attribute must be an instance of AudioBuffer".
PASS   conv.buffer = oc.createBuffer(1, 100, 22050) threw NotSupportedError: "Buffer sample rate does not match the context's sample rate".
PASS   conv.buffer is equal to null.
PASS < [convolver] All assertions passed. (total 5 assertions)
```

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221114/73441e2f/attachment-0001.htm>


More information about the webkit-unassigned mailing list