Changeset 268999 in webkit
- Timestamp:
- Oct 26, 2020 4:09:16 PM (21 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/webaudio/audiocontext-state.html (modified) (1 diff)
-
LayoutTests/webaudio/construct-node-with-closed-context-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webaudio/AudioContext.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r268997 r268999 1 2020-10-26 Chris Dumez <cdumez@apple.com> 2 3 Improve exception messages when AudioContext.suspend() / resume() promises are rejected 4 https://bugs.webkit.org/show_bug.cgi?id=218210 5 6 Reviewed by Geoffrey Garen. 7 8 * webaudio/audiocontext-state.html: 9 Stop expecting that the resume() promise is rejected without any exception. 10 This is not standard behavior and does not match the behavior of other 11 browsers either. 12 13 * webaudio/construct-node-with-closed-context-expected.txt: 14 Rebaseline test now that exception messages have been improved. 15 1 16 2020-10-26 Truitt Savell <tsavell@apple.com> 2 17 -
trunk/LayoutTests/webaudio/audiocontext-state.html
r267504 r268999 94 94 function resumeFailedCorrectly(value) { 95 95 testPassed('context.resume() promise rejected (correctly)'); 96 if (typeof value != 'undefined')97 testFailed('No value should be passed to the context.resume() promise rejected callback');98 96 shouldBe('context.state', '"closed"'); 99 97 -
trunk/LayoutTests/webaudio/construct-node-with-closed-context-expected.txt
r267639 r268999 41 41 PASS context.createWaveShaper() did not throw exception. 42 42 PASS context.createScriptProcessor() did not throw exception. 43 PASS context.suspend() rejected promise with InvalidStateError: The object is in an invalid state..44 PASS context.resume() rejected promise with InvalidStateError: The object is in an invalid state..43 PASS context.suspend() rejected promise with InvalidStateError: Context is closed. 44 PASS context.resume() rejected promise with InvalidStateError: Context is closed. 45 45 PASS context.close() rejected promise with InvalidStateError: The object is in an invalid state.. 46 46 PASS successfullyParsed is true -
trunk/Source/WebCore/ChangeLog
r268998 r268999 1 2020-10-26 Chris Dumez <cdumez@apple.com> 2 3 Improve exception messages when AudioContext.suspend() / resume() promises are rejected 4 https://bugs.webkit.org/show_bug.cgi?id=218210 5 6 Reviewed by Geoffrey Garen. 7 8 Improve exception messages when AudioContext.suspend() / resume() promises are rejected. 9 10 No new tests, rebaselined existing tests. 11 12 * Modules/webaudio/AudioContext.cpp: 13 (WebCore::AudioContext::suspendRendering): 14 (WebCore::AudioContext::resumeRendering): 15 1 16 2020-10-26 Adrian Perez de Castro <aperez@igalia.com> 2 17 -
trunk/Source/WebCore/Modules/webaudio/AudioContext.cpp
r268893 r268999 205 205 void AudioContext::suspendRendering(DOMPromiseDeferred<void>&& promise) 206 206 { 207 if (isOfflineContext() || isStopped()) {208 promise.reject( InvalidStateError);209 return; 210 } 211 212 if ( state() == State::Closed || state() == State::Interrupted || !destinationNode()) {213 promise.reject( );207 if (isOfflineContext()) { 208 promise.reject(Exception { InvalidStateError, "Cannot call suspend() on an OfflineAudioContext"_s }); 209 return; 210 } 211 212 if (isStopped() || state() == State::Closed || state() == State::Interrupted || !destinationNode()) { 213 promise.reject(Exception { InvalidStateError, "Context is closed"_s }); 214 214 return; 215 215 } … … 230 230 void AudioContext::resumeRendering(DOMPromiseDeferred<void>&& promise) 231 231 { 232 if (isOfflineContext() || isStopped()) {233 promise.reject( InvalidStateError);234 return; 235 } 236 237 if ( state() == State::Closed || !destinationNode()) {238 promise.reject( );232 if (isOfflineContext()) { 233 promise.reject(Exception { InvalidStateError, "Cannot call resume() on an OfflineAudioContext"_s }); 234 return; 235 } 236 237 if (isStopped() || state() == State::Closed || !destinationNode()) { 238 promise.reject(Exception { InvalidStateError, "Context is closed"_s }); 239 239 return; 240 240 }
Note: See TracChangeset
for help on using the changeset viewer.