Changeset 267066 in webkit
- Timestamp:
- Sep 14, 2020 6:59:20 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r267065 r267066 1 2020-09-14 Chris Dumez <cdumez@apple.com> 2 3 Type of AnalyserNode's attributes should not be unrestricted double 4 https://bugs.webkit.org/show_bug.cgi?id=216505 5 6 Reviewed by Darin Adler. 7 8 Extend layout test coverage. 9 10 * webaudio/analyser-exception-expected.txt: 11 * webaudio/analyser-exception.html: 12 1 13 2020-09-14 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/ChangeLog
r267060 r267066 1 2020-09-14 Chris Dumez <cdumez@apple.com> 2 3 Type of AnalyserNode's attributes should not be unrestricted double 4 https://bugs.webkit.org/show_bug.cgi?id=216505 5 6 Reviewed by Darin Adler. 7 8 Rebaseline existing WPT test now that the exception message was improved. 9 10 * web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser-expected.txt: 11 1 12 2020-09-14 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webaudio/the-audio-api/the-analysernode-interface/ctor-analyser-expected.txt
r266559 r267066 65 65 PASS node = new AnalyserNode(c, { maxDecibels: -500 }) threw IndexSizeError: "minDecibels must be less than maxDecibels.". 66 66 PASS node = new AnalyserNode(c, { minDecibels: -10 }) threw IndexSizeError: "minDecibels must be less than maxDecibels.". 67 PASS node = new AnalyserNode(c, { smoothingTimeConstant: 2 }) threw IndexSizeError: " The index is not in the allowed range.".67 PASS node = new AnalyserNode(c, { smoothingTimeConstant: 2 }) threw IndexSizeError: "Smoothing time constant needs to be between 0 and 1.". 68 68 PASS node = new AnalyserNode(c, { frequencyBinCount: 33 }) did not throw an exception. 69 69 PASS node.frequencyBinCount is equal to 1024. -
trunk/LayoutTests/webaudio/analyser-exception-expected.txt
r265196 r267066 4 4 5 5 PASS analyser.minDecibels = -20 threw exception IndexSizeError: minDecibels must be less than maxDecibels.. 6 PASS analyser.minDecibels = NaN threw exception TypeError: The provided value is non-finite. 7 PASS analyser.minDecibels = Infinity threw exception TypeError: The provided value is non-finite. 8 PASS analyser.minDecibels = -Infinity threw exception TypeError: The provided value is non-finite. 6 9 PASS analyser.maxDecibels = -120 threw exception IndexSizeError: maxDecibels must be greater than minDecibels.. 7 PASS analyser.smoothingTimeConstant = 2 threw exception IndexSizeError: The index is not in the allowed range.. 10 PASS analyser.maxDecibels = NaN threw exception TypeError: The provided value is non-finite. 11 PASS analyser.maxDecibels = Infinity threw exception TypeError: The provided value is non-finite. 12 PASS analyser.maxDecibels = -Infinity threw exception TypeError: The provided value is non-finite. 13 PASS analyser.smoothingTimeConstant = 2 threw exception IndexSizeError: Smoothing time constant needs to be between 0 and 1.. 14 PASS analyser.smoothingTimeConstant = -1 threw exception IndexSizeError: Smoothing time constant needs to be between 0 and 1.. 15 PASS analyser.smoothingTimeConstant = NaN threw exception TypeError: The provided value is non-finite. 16 PASS analyser.smoothingTimeConstant = Infinity threw exception TypeError: The provided value is non-finite. 17 PASS analyser.smoothingTimeConstant = -Infinity threw exception TypeError: The provided value is non-finite. 8 18 PASS successfullyParsed is true 9 19 -
trunk/LayoutTests/webaudio/analyser-exception.html
r219663 r267066 29 29 // 'minDecibels' shouldn't be greater than 'maxDecibels' which defaults to -30dB. 30 30 shouldThrowErrorName("analyser.minDecibels = -20", "IndexSizeError"); 31 shouldThrowErrorName("analyser.minDecibels = NaN", "TypeError"); 32 shouldThrowErrorName("analyser.minDecibels = Infinity", "TypeError"); 33 shouldThrowErrorName("analyser.minDecibels = -Infinity", "TypeError"); 31 34 32 35 // 'maxDecibels' shouldn't be less than 'minDecibels' which defaults to -100dB. 33 36 shouldThrowErrorName("analyser.maxDecibels = -120", "IndexSizeError"); 37 shouldThrowErrorName("analyser.maxDecibels = NaN", "TypeError"); 38 shouldThrowErrorName("analyser.maxDecibels = Infinity", "TypeError"); 39 shouldThrowErrorName("analyser.maxDecibels = -Infinity", "TypeError"); 34 40 35 41 // 'smoothingTimeConstant' range is between 0 and 1. 36 42 shouldThrowErrorName("analyser.smoothingTimeConstant = 2", "IndexSizeError"); 43 shouldThrowErrorName("analyser.smoothingTimeConstant = -1", "IndexSizeError"); 44 shouldThrowErrorName("analyser.smoothingTimeConstant = NaN", "TypeError"); 45 shouldThrowErrorName("analyser.smoothingTimeConstant = Infinity", "TypeError"); 46 shouldThrowErrorName("analyser.smoothingTimeConstant = -Infinity", "TypeError"); 37 47 38 48 context.oncomplete = finishJSTest; -
trunk/Source/WebCore/ChangeLog
r267065 r267066 1 2020-09-14 Chris Dumez <cdumez@apple.com> 2 3 Type of AnalyserNode's attributes should not be unrestricted double 4 https://bugs.webkit.org/show_bug.cgi?id=216505 5 6 Reviewed by Darin Adler. 7 8 Type of AnalyserNode's attributes should not be unrestricted double. They should use double type 9 so that we throw when trying to set them to NaN or infinity values. 10 11 No new tests, updated existing test. 12 13 * Modules/webaudio/AnalyserNode.cpp: 14 (WebCore::AnalyserNode::setSmoothingTimeConstant): 15 * Modules/webaudio/AnalyserNode.idl: 16 1 17 2020-09-14 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebCore/Modules/webaudio/AnalyserNode.cpp
r266417 r267066 142 142 { 143 143 if (k < 0 || k > 1) 144 return Exception { IndexSizeError };144 return Exception { IndexSizeError, "Smoothing time constant needs to be between 0 and 1."_s }; 145 145 146 146 m_analyser.setSmoothingTimeConstant(k); -
trunk/Source/WebCore/Modules/webaudio/AnalyserNode.idl
r267007 r267066 33 33 34 34 // minDecibels / maxDecibels represent the range to scale the FFT analysis data for conversion to unsigned byte values. 35 attribute unrestricteddouble minDecibels;36 attribute unrestricteddouble maxDecibels;35 attribute double minDecibels; 36 attribute double maxDecibels; 37 37 38 38 // A value from 0.0 -> 1.0 where 0.0 represents no time averaging with the last analysis frame. 39 attribute unrestricteddouble smoothingTimeConstant;39 attribute double smoothingTimeConstant; 40 40 41 41 // Copies the current frequency data into the passed array.
Note: See TracChangeset
for help on using the changeset viewer.