WebKit Bugzilla
Attachment 339469 Details for
Bug 185267
: PeerConnection should have its connectionState closed even if doing gathering
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185267-20180503144319.patch (text/plain), 6.34 KB, created by
youenn fablet
on 2018-05-03 14:43:20 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-05-03 14:43:20 PDT
Size:
6.34 KB
patch
obsolete
>Subversion Revision: 231318 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 3d08a6be1cfb4d18a56aaa9b4364ce72b523a959..8ae0fcab720717762c4e3d993c5e2db17d14847b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2018-05-03 Youenn Fablet <youenn@apple.com> >+ >+ PeerConnection should have its connectionState closed even if doing gathering >+ https://bugs.webkit.org/show_bug.cgi?id=185267 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: webrtc/addICECandidate-closed.html >+ >+ In case m_iceConnectionState is closed, m_connectionState should also be set to closed >+ and RTCPeerConnection should be closed so as to reject any other call. >+ >+ * Modules/mediastream/RTCPeerConnection.cpp: >+ (WebCore::RTCPeerConnection::close): >+ (WebCore::RTCPeerConnection::updateConnectionState): >+ > 2018-05-03 Zalan Bujtas <zalan@apple.com> > > [LFC] Enable multiple layout roots for incremental layout. >diff --git a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >index 851c9c82af4097eed35f610c7acf5d25dbd44b35..6b2b7ae8f68e101231a58038bc955574151f5f04 100644 >--- a/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >+++ b/Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp >@@ -423,6 +423,7 @@ void RTCPeerConnection::close() > return; > > updateConnectionState(); >+ ASSERT(isClosed()); > scriptExecutionContext()->postTask([protectedThis = makeRef(*this)](ScriptExecutionContext&) { > protectedThis->doStop(); > }); >@@ -524,19 +525,18 @@ void RTCPeerConnection::updateConnectionState() > { > RTCPeerConnectionState state; > >- // FIXME: In case m_iceGatheringState is RTCIceGatheringState::Gathering, and m_iceConnectionState is Closed, we should have the connection state be Closed. >- if (m_iceConnectionState == RTCIceConnectionState::New && m_iceGatheringState == RTCIceGatheringState::New) >+ if (m_iceConnectionState == RTCIceConnectionState::Closed) >+ state = RTCPeerConnectionState::Closed; >+ else if (m_iceConnectionState == RTCIceConnectionState::Disconnected) >+ state = RTCPeerConnectionState::Disconnected; >+ else if (m_iceConnectionState == RTCIceConnectionState::Failed) >+ state = RTCPeerConnectionState::Failed; >+ else if (m_iceConnectionState == RTCIceConnectionState::New && m_iceGatheringState == RTCIceGatheringState::New) > state = RTCPeerConnectionState::New; > else if (m_iceConnectionState == RTCIceConnectionState::Checking || m_iceGatheringState == RTCIceGatheringState::Gathering) > state = RTCPeerConnectionState::Connecting; > else if ((m_iceConnectionState == RTCIceConnectionState::Completed || m_iceConnectionState == RTCIceConnectionState::Connected) && m_iceGatheringState == RTCIceGatheringState::Complete) > state = RTCPeerConnectionState::Connected; >- else if (m_iceConnectionState == RTCIceConnectionState::Disconnected) >- state = RTCPeerConnectionState::Disconnected; >- else if (m_iceConnectionState == RTCIceConnectionState::Failed) >- state = RTCPeerConnectionState::Failed; >- else if (m_iceConnectionState == RTCIceConnectionState::Closed) >- state = RTCPeerConnectionState::Closed; > else > return; > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 223874684233497ab697ca553d563b64bdfc2631..cf23d12285215ce9b405596e3bf41b148b7a69b0 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,13 @@ >+2018-05-03 Youenn Fablet <youenn@apple.com> >+ >+ PeerConnection should have its connectionState closed even if doing gathering >+ https://bugs.webkit.org/show_bug.cgi?id=185267 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * webrtc/addICECandidate-closed-expected.txt: Added. >+ * webrtc/addICECandidate-closed.html: Added. >+ > 2018-05-03 Chris Dumez <cdumez@apple.com> > > REGRESSION: Layout Test http/tests/security/location-cross-origin.html is a flaky failure >diff --git a/LayoutTests/webrtc/addICECandidate-closed-expected.txt b/LayoutTests/webrtc/addICECandidate-closed-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..6b7dc893edc79b32ceb4cbd07c68710970762a0c >--- /dev/null >+++ b/LayoutTests/webrtc/addICECandidate-closed-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Close a peer connection in the middle of gathering >+ >diff --git a/LayoutTests/webrtc/addICECandidate-closed.html b/LayoutTests/webrtc/addICECandidate-closed.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2f5a6d695007355434078394b0b766850a556f7b >--- /dev/null >+++ b/LayoutTests/webrtc/addICECandidate-closed.html >@@ -0,0 +1,43 @@ >+<!doctype html> >+<html> >+<head> >+ <script src="../resources/testharness.js"></script> >+ <script src="../resources/testharnessreport.js"></script> >+</head> >+<body> >+<script type="application/javascript"> >+window.onunhandledrejection = () => false; >+promise_test(async (test) => { >+ const sender = new RTCPeerConnection(); >+ const receiver = new RTCPeerConnection(); >+ try { >+ const stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: true }); >+ const localTracks = stream.getTracks(); >+ [[sender, receiver], [receiver, sender]].forEach(([pc1, pc2]) => { >+ pc1.onicecandidate = ({ candidate }) => { >+ if (candidate) >+ pc2.addIceCandidate(candidate); >+ pc1.close(); >+ }; >+ }); >+ localTracks.forEach(track => sender.addTrack(track, stream)); >+ receiver.addTransceiver('audio'); >+ receiver.addTransceiver('video'); >+ const offer1 = await sender.createOffer(); >+ await sender.setLocalDescription(offer1); >+ await receiver.setRemoteDescription(offer1); >+ const answer1 = await receiver.createAnswer(); >+ await receiver.setLocalDescription(answer1); >+ await sender.setRemoteDescription(answer1); >+ const offer2 = await sender.createOffer(); >+ await sender.setLocalDescription(offer2); >+ await receiver.setRemoteDescription(offer2); >+ const answer2 = await receiver.createAnswer(); >+ await receiver.setLocalDescription(answer2); >+ await sender.setRemoteDescription(answer2); >+ } catch (e) { >+ } >+}, "Close a peer connection in the middle of gathering"); >+</script> >+</body> >+</html>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185267
: 339469 |
339525