Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (239191 => 239192)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-12-14 02:19:20 UTC (rev 239192)
@@ -1,3 +1,13 @@
+2018-12-13 Youenn Fablet <[email protected]>
+
+ RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
+ https://bugs.webkit.org/show_bug.cgi?id=192685
+
+ Reviewed by Eric Carlson.
+
+ * web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-expected.txt:
+ * web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html:
+
2018-12-10 Rob Buis <[email protected]>
XMLHttpRequest removes spaces from content-types before processing
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-expected.txt (239191 => 239192)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-expected.txt 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver-expected.txt 2018-12-14 02:19:20 UTC (rev 239192)
@@ -4,4 +4,5 @@
FAIL setLocalDescription(rollback) should unset transceiver.mid promise_test: Unhandled rejection with value: object "InvalidStateError: Description type incompatible with current signaling state"
FAIL setLocalDescription(rollback) should only unset transceiver mids associated with current round promise_test: Unhandled rejection with value: object "InvalidStateError: Description type incompatible with current signaling state"
FAIL setRemoteDescription(rollback) should remove newly created transceiver from transceiver list promise_test: Unhandled rejection with value: object "InvalidStateError: Description type incompatible with current signaling state"
+PASS setRemoteDescription should stop the transceiver if its corresponding m section is rejected
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html (239191 => 239192)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setDescription-transceiver.html 2018-12-14 02:19:20 UTC (rev 239192)
@@ -238,6 +238,27 @@
});
}, 'setRemoteDescription(rollback) should remove newly created transceiver from transceiver list');
+ promise_test(async t => {
+ const pc1 = new RTCPeerConnection();
+ t.add_cleanup(() => pc1.close());
+ const pc2 = new RTCPeerConnection();
+ t.add_cleanup(() => pc2.close());
+
+ pc1.addTransceiver('audio');
+ const offer = await pc1.createOffer();
+ await pc1.setLocalDescription(offer);
+
+ assert_false(pc1.getTransceivers()[0].stopped, 'Transceiver is not stopped');
+
+ await pc2.setRemoteDescription(offer);
+ pc2.getTransceivers()[0].stop();
+ const answer = await pc2.createAnswer();
+
+ await pc1.setRemoteDescription(answer);
+
+ assert_true(pc1.getTransceivers()[0].stopped, 'Transceiver is stopped');
+ }, 'setRemoteDescription should stop the transceiver if its corresponding m section is rejected');
+
/*
TODO
- Steps for transceiver direction is added to tip of tree draft, but not yet
Modified: trunk/Source/WebCore/ChangeLog (239191 => 239192)
--- trunk/Source/WebCore/ChangeLog 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/Source/WebCore/ChangeLog 2018-12-14 02:19:20 UTC (rev 239192)
@@ -1,3 +1,25 @@
+2018-12-13 Youenn Fablet <[email protected]>
+
+ RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
+ https://bugs.webkit.org/show_bug.cgi?id=192685
+
+ Reviewed by Eric Carlson.
+
+ In case the remote description contains a rejected m section,
+ the corresponding transceiver should be marked as stopped.
+ Libwebrtc backend has that information so pipe it up to JS.
+
+ Covered by updated WPT test.
+
+ * Modules/mediastream/RTCRtpTransceiver.cpp:
+ (WebCore::RTCRtpTransceiver::stopped const):
+ * Modules/mediastream/RTCRtpTransceiver.h:
+ (WebCore::RTCRtpTransceiver::stopped const): Deleted.
+ * Modules/mediastream/RTCRtpTransceiverBackend.h:
+ * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
+ (WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
+ * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
+
2018-12-13 Mark Lam <[email protected]>
Ensure that StructureFlags initialization always starts with Base::StructureFlags.
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp (239191 => 239192)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.cpp 2018-12-14 02:19:20 UTC (rev 239192)
@@ -114,6 +114,13 @@
m_transceivers.append(WTFMove(transceiver));
}
+bool RTCRtpTransceiver::stopped() const
+{
+ if (m_backend)
+ return m_backend->stopped();
+ return m_stopped;
+}
+
} // namespace WebCore
#endif // ENABLE(WEB_RTC)
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h (239191 => 239192)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiver.h 2018-12-14 02:19:20 UTC (rev 239192)
@@ -62,7 +62,7 @@
RTCRtpSender& sender() { return m_sender.get(); }
RTCRtpReceiver& receiver() { return m_receiver.get(); }
- bool stopped() const { return m_stopped; }
+ bool stopped() const;
void stop();
// FIXME: Temporary solution to keep track of ICE states for this transceiver. Later, each
Modified: trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiverBackend.h (239191 => 239192)
--- trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiverBackend.h 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/Source/WebCore/Modules/mediastream/RTCRtpTransceiverBackend.h 2018-12-14 02:19:20 UTC (rev 239192)
@@ -40,6 +40,7 @@
virtual String mid() = 0;
virtual void stop() = 0;
+ virtual bool stopped() const = 0;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp (239191 => 239192)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp 2018-12-14 02:19:20 UTC (rev 239192)
@@ -73,6 +73,11 @@
m_rtcTransceiver->Stop();
}
+bool LibWebRTCRtpTransceiverBackend::stopped() const
+{
+ return m_rtcTransceiver->stopped();
+}
+
} // namespace WebCore
#endif // ENABLE(WEB_RTC) && USE(LIBWEBRTC)
Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h (239191 => 239192)
--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h 2018-12-14 02:14:28 UTC (rev 239191)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h 2018-12-14 02:19:20 UTC (rev 239192)
@@ -59,6 +59,7 @@
void setDirection(RTCRtpTransceiverDirection) final;
String mid() final;
void stop() final;
+ bool stopped() const final;
rtc::scoped_refptr<webrtc::RtpTransceiverInterface> m_rtcTransceiver;
};