RTCPeerConnection's close method should update signalingState
authoryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2018 21:16:35 +0000 (21:16 +0000)
committeryouenn@apple.com <youenn@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 12 Mar 2018 21:16:35 +0000 (21:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174314
<rdar://problem/33267977>

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt:

Source/WebCore:

Covered by rebased test.
Add closed as signalingState enum value.
Set peer connection signaling state to closed once close is called.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::doClose):
* Modules/mediastream/RTCSignalingState.idl:
* platform/mediastream/RTCSignalingState.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229548 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCSignalingState.idl
Source/WebCore/platform/mediastream/RTCSignalingState.h

index a362fd8..184d9e1 100644 (file)
@@ -1,3 +1,13 @@
+2018-03-12  Youenn Fablet  <youenn@apple.com>
+
+        RTCPeerConnection's close method should update signalingState
+        https://bugs.webkit.org/show_bug.cgi?id=174314
+        <rdar://problem/33267977>
+
+        Reviewed by Eric Carlson.
+
+        * web-platform-tests/webrtc/RTCPeerConnection-createDataChannel-expected.txt:
+
 2018-03-12  Chris Dumez  <cdumez@apple.com>
 
         Re-sync dom web-platform-tests
index 04e528b..2af1ce8 100644 (file)
@@ -1,6 +1,6 @@
 
 PASS createDataChannel with no argument should throw TypeError 
-FAIL createDataChannel with closed connection should throw InvalidStateError assert_equals: signaling state expected "closed" but got "stable"
+PASS createDataChannel with closed connection should throw InvalidStateError 
 FAIL createDataChannel attribute default values assert_equals: expected (string) "low" but got (undefined) undefined
 FAIL createDataChannel with provided parameters should initialize attributes to provided values Type error
 PASS createDataChannel with label "foo" should succeed 
index 00440a1..13e8a4d 100644 (file)
@@ -1,3 +1,20 @@
+2018-03-12  Youenn Fablet  <youenn@apple.com>
+
+        RTCPeerConnection's close method should update signalingState
+        https://bugs.webkit.org/show_bug.cgi?id=174314
+        <rdar://problem/33267977>
+
+        Reviewed by Eric Carlson.
+
+        Covered by rebased test.
+        Add closed as signalingState enum value.
+        Set peer connection signaling state to closed once close is called.
+
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        (WebCore::RTCPeerConnection::doClose):
+        * Modules/mediastream/RTCSignalingState.idl:
+        * platform/mediastream/RTCSignalingState.h:
+
 2018-03-12  Mark Lam  <mark.lam@apple.com>
 
         Make a NativeFunction into a class to support pointer profiling.
index f80fb84..9f3a174 100644 (file)
@@ -394,6 +394,7 @@ bool RTCPeerConnection::doClose()
 
     m_connectionState = RTCPeerConnectionState::Closed;
     m_iceConnectionState = RTCIceConnectionState::Closed;
+    m_signalingState = RTCSignalingState::Closed;
 
     for (auto& transceiver : m_transceiverSet->list()) {
         transceiver->stop();
index 222bcf9..c79f499 100644 (file)
@@ -31,5 +31,6 @@
     "have-local-offer",
     "have-remote-offer",
     "have-local-pranswer",
-    "have-remote-pranswer"
+    "have-remote-pranswer",
+    "closed"
 };
index 494977d..4465ee1 100644 (file)
@@ -34,6 +34,7 @@ enum class RTCSignalingState {
     HaveRemoteOffer,
     HaveLocalPranswer,
     HaveRemotePranswer,
+    Closed,
 };
 
 String convertEnumerationToString(RTCSignalingState); // in JSCRTCSignalingState.cpp