Changeset 282198 in webkit
- Timestamp:
- Sep 9, 2021 12:21:18 AM (10 months ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (1 diff)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-close-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/webrtc/idlharness.https.window-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/RTCDataChannel.cpp (modified) (4 diffs)
-
Source/WebCore/Modules/mediastream/RTCDataChannel.idl (modified) (1 diff)
-
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp (modified) (3 diffs)
-
Source/WebCore/dom/EventNames.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r282197 r282198 1 2021-09-09 Youenn Fablet <youenn@apple.com> 2 3 Add support for RTCDataChannel closing event 4 https://bugs.webkit.org/show_bug.cgi?id=229988 5 6 Reviewed by Eric Carlson. 7 8 * TestExpectations: 9 Unskip no longer timing out test. 10 1 11 2021-09-09 Youenn Fablet <youenn@apple.com> 2 12 -
trunk/LayoutTests/TestExpectations
r282195 r282198 2195 2195 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-remote-track-mute.https.html [ Skip ] 2196 2196 imported/w3c/web-platform-tests/webrtc/RTCDataChannel-bufferedAmount.html [ Skip ] 2197 imported/w3c/web-platform-tests/webrtc/RTCDataChannel-close.html [ Skip ]2198 2197 imported/w3c/web-platform-tests/webrtc/RTCIceConnectionState-candidate-pair.https.html [ Skip ] 2199 2198 imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-mandatory-getStats.https.html [ Skip ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r282197 r282198 1 2021-09-09 Youenn Fablet <youenn@apple.com> 2 3 Add support for RTCDataChannel closing event 4 https://bugs.webkit.org/show_bug.cgi?id=229988 5 6 Reviewed by Eric Carlson. 7 8 * web-platform-tests/webrtc/RTCDataChannel-close-expected.txt: 9 * web-platform-tests/webrtc/idlharness.https.window-expected.txt: 10 1 11 2021-09-09 Youenn Fablet <youenn@apple.com> 2 12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCDataChannel-close-expected.txt
r267649 r282198 1 1 2 Harness Error (TIMEOUT), message = null 2 PASS Close datachannel causes onclosing and onclose to be called 3 PASS Close datachannel causes closing and close event to be called 4 FAIL Close peerconnection causes close event and error to be called on datachannel Can't find variable: RTCErrorEvent 5 PASS Close peerconnection after datachannel close causes no events 6 PASS Close negotiated datachannel causes onclosing and onclose to be called 7 PASS Close negotiated datachannel causes closing and close event to be called 8 FAIL Close peerconnection causes close event and error to be called on negotiated datachannel Can't find variable: RTCErrorEvent 9 PASS Close peerconnection after negotiated datachannel close causes no events 3 10 4 FAIL Close datachannel causes onclosing and onclose to be called assert_true: Closing event was seen expected true got false5 FAIL Close datachannel causes closing and close event to be called assert_true: Closing event was seen expected true got false6 FAIL Close peerconnection causes close event and error to be called on datachannel assert_array_equals: lengths differ, expected array ["error", "close"] length 2, got ["close"] length 17 TIMEOUT Close peerconnection after datachannel close causes no events Test timed out8 NOTRUN Close negotiated datachannel causes onclosing and onclose to be called9 NOTRUN Close negotiated datachannel causes closing and close event to be called10 NOTRUN Close peerconnection causes close event and error to be called on negotiated datachannel11 NOTRUN Close peerconnection after negotiated datachannel close causes no events12 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/idlharness.https.window-expected.txt
r282197 r282198 405 405 PASS RTCDataChannel interface: attribute onbufferedamountlow 406 406 PASS RTCDataChannel interface: attribute onerror 407 FAIL RTCDataChannel interface: attribute onclosing assert_true: The prototype object must have a property "onclosing" expected true got false 407 PASS RTCDataChannel interface: attribute onclosing 408 408 PASS RTCDataChannel interface: attribute onclose 409 409 PASS RTCDataChannel interface: operation close() … … 429 429 PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "onbufferedamountlow" with the proper type 430 430 PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "onerror" with the proper type 431 FAIL RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "onclosing" with the proper type assert_inherits: property "onclosing" not found in prototype chain 431 PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "onclosing" with the proper type 432 432 PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "onclose" with the proper type 433 433 PASS RTCDataChannel interface: new RTCPeerConnection().createDataChannel('') must inherit property "close()" with the proper type -
trunk/Source/WebCore/ChangeLog
r282197 r282198 1 2021-09-09 Youenn Fablet <youenn@apple.com> 2 3 Add support for RTCDataChannel closing event 4 https://bugs.webkit.org/show_bug.cgi?id=229988 5 6 Reviewed by Eric Carlson. 7 8 Add support for the closing event. 9 Updating close method as per https://w3c.github.io/webrtc-pc/#dom-rtcdatachannel-close: 10 - make the channel enter closing state (without firing event) 11 - wait for the state to move to closed from the backend. 12 13 We also add support for the error event by checking, when entering closed state whether 14 the channel is in an error state. 15 16 Covered by rebased test. 17 18 * Modules/mediastream/RTCDataChannel.cpp: 19 (WebCore::RTCDataChannel::close): 20 (WebCore::RTCDataChannel::didChangeReadyState): 21 (WebCore::RTCDataChannel::stop): 22 * Modules/mediastream/RTCDataChannel.idl: 23 * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: 24 (WebCore::LibWebRTCDataChannelHandler::checkState): 25 * dom/EventNames.h: 26 1 27 2021-09-09 Youenn Fablet <youenn@apple.com> 2 28 -
trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.cpp
r278702 r282198 176 176 return; 177 177 178 m_stopped = true; 179 m_readyState = RTCDataChannelState::Closed; 178 if (m_readyState == RTCDataChannelState::Closing || m_readyState == RTCDataChannelState::Closed) 179 return; 180 181 m_readyState = RTCDataChannelState::Closing; 180 182 181 183 m_messageQueue.clear(); … … 183 185 if (m_handler) 184 186 m_handler->close(); 185 m_handler = nullptr;186 187 } 187 188 … … 199 200 200 201 switch (m_readyState) { 202 case RTCDataChannelState::Connecting: 203 ASSERT_NOT_REACHED(); 204 break; 201 205 case RTCDataChannelState::Open: 202 206 scheduleDispatchEvent(Event::create(eventNames().openEvent, Event::CanBubble::No, Event::IsCancelable::No)); 203 207 break; 208 case RTCDataChannelState::Closing: 209 scheduleDispatchEvent(Event::create(eventNames().closingEvent, Event::CanBubble::No, Event::IsCancelable::No)); 210 break; 204 211 case RTCDataChannelState::Closed: 205 212 scheduleDispatchEvent(Event::create(eventNames().closeEvent, Event::CanBubble::No, Event::IsCancelable::No)); 206 break; 207 default: 213 m_stopped = true; 208 214 break; 209 215 } … … 246 252 247 253 close(); 254 m_stopped = true; 255 m_handler = nullptr; 248 256 } 249 257 -
trunk/Source/WebCore/Modules/mediastream/RTCDataChannel.idl
r276204 r282198 56 56 attribute EventHandler onerror; 57 57 attribute EventHandler onclose; 58 attribute EventHandler onclosing; 58 59 attribute EventHandler onmessage; 59 60 attribute EventHandler onbufferedamountlow; -
trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp
r278532 r282198 130 130 void LibWebRTCDataChannelHandler::checkState() 131 131 { 132 bool hasError = false; 132 133 RTCDataChannelState state; 133 134 switch (m_channel->state()) { … … 142 143 break; 143 144 case webrtc::DataChannelInterface::kClosed: 145 hasError = !m_channel->error().ok(); 144 146 state = RTCDataChannelState::Closed; 145 147 break; … … 151 153 return; 152 154 } 153 postTask([protectedClient = makeRef(*m_client), state] { 155 postTask([protectedClient = makeRef(*m_client), state, hasError] { 156 if (hasError) 157 protectedClient->didDetectError(); 154 158 protectedClient->didChangeReadyState(state); 155 159 }); -
trunk/Source/WebCore/dom/EventNames.h
r281796 r282198 90 90 macro(click) \ 91 91 macro(close) \ 92 macro(closing) \ 92 93 macro(complete) \ 93 94 macro(compositionend) \
Note: See TracChangeset
for help on using the changeset viewer.