https://bugs.webkit.org/show_bug.cgi?id=191603
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
* web-platform-tests/webrtc/RTCPeerConnection-removeTrack.https-expected.txt:
Source/WebCore:
Make sure to check that the sender peer connection backend is matching.
Covered by rebased WPT test.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::removeTrack):
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::isCreatedBy const):
* Modules/mediastream/RTCRtpSender.h:
LayoutTests:
Removed obsolete test.
* fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt:
* fast/mediastream/RTCPeerConnection-add-removeTrack.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238180
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
2018-11-14 Youenn Fablet <youenn@apple.com>
+ Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
+ https://bugs.webkit.org/show_bug.cgi?id=191603
+
+ Reviewed by Chris Dumez.
+
+ Removed obsolete test.
+
+ * fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt:
+ * fast/mediastream/RTCPeerConnection-add-removeTrack.html:
+
+2018-11-14 Youenn Fablet <youenn@apple.com>
+
Add support for transport and peerConnection stats
https://bugs.webkit.org/show_bug.cgi?id=191592
PASS pc.removeTrack(sender) did not throw exception.
Sender is still in getSenders() list
PASS pc.getSenders().length is 2
-PASS senderFromPc2 = pc2.addTrack(track, stream) did not throw exception.
-removeTrack() with 'foreign' sender must be ignored (not throw)
-PASS pc.removeTrack(senderFromPc2) did not throw exception.
PASS pc.addTrack(null); threw exception TypeError: Argument 1 ('track') to RTCPeerConnection.addTrack must be an instance of MediaStreamTrack.
PASS pc.addTrack(undefined); threw exception TypeError: Argument 1 ('track') to RTCPeerConnection.addTrack must be an instance of MediaStreamTrack.
PASS pc.removeTrack(null); threw exception TypeError: Argument 1 ('sender') to RTCPeerConnection.removeTrack must be an instance of RTCRtpSender.
debug("Sender is still in getSenders() list")
shouldBe("pc.getSenders().length", "2");
- shouldNotThrow("senderFromPc2 = pc2.addTrack(track, stream)");
- debug("removeTrack() with 'foreign' sender must be ignored (not throw)");
- shouldNotThrow("pc.removeTrack(senderFromPc2)");
-
shouldThrow("pc.addTrack(null);");
shouldThrow("pc.addTrack(undefined);");
shouldThrow("pc.removeTrack(null);");
2018-11-14 Youenn Fablet <youenn@apple.com>
+ Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
+ https://bugs.webkit.org/show_bug.cgi?id=191603
+
+ Reviewed by Chris Dumez.
+
+ * web-platform-tests/webrtc/RTCPeerConnection-removeTrack.https-expected.txt:
+
+2018-11-14 Youenn Fablet <youenn@apple.com>
+
Add support for RTCRtpCodecParameters.sdpFmtpLine
https://bugs.webkit.org/show_bug.cgi?id=191591
PASS addTrack - Calling removeTrack when connection is closed should throw InvalidStateError
PASS addTransceiver - Calling removeTrack on different connection that is closed should throw InvalidStateError
PASS addTrack - Calling removeTrack on different connection that is closed should throw InvalidStateError
-FAIL addTransceiver - Calling removeTrack on different connection should throw InvalidAccessError assert_throws: function "() => pc2.removeTrack(sender)" did not throw
-FAIL addTrack - Calling removeTrack on different connection should throw InvalidAccessError assert_throws: function "() => pc2.removeTrack(sender)" did not throw
+PASS addTransceiver - Calling removeTrack on different connection should throw InvalidAccessError
+PASS addTrack - Calling removeTrack on different connection should throw InvalidAccessError
PASS addTransceiver - Calling removeTrack with valid sender should set sender.track to null
PASS addTrack - Calling removeTrack with valid sender should set sender.track to null
PASS Calling removeTrack with currentDirection sendrecv should set direction to recvonly
+2018-11-14 Youenn Fablet <youenn@apple.com>
+
+ Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
+ https://bugs.webkit.org/show_bug.cgi?id=191603
+
+ Reviewed by Chris Dumez.
+
+ Make sure to check that the sender peer connection backend is matching.
+ Covered by rebased WPT test.
+
+ * Modules/mediastream/RTCPeerConnection.cpp:
+ (WebCore::RTCPeerConnection::removeTrack):
+ * Modules/mediastream/RTCRtpSender.cpp:
+ (WebCore::RTCRtpSender::isCreatedBy const):
+ * Modules/mediastream/RTCRtpSender.h:
+
2018-11-14 Fujii Hironori <Hironori.Fujii@sony.com>
[curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
INFO_LOG(LOGIDENTIFIER);
if (isClosed())
- return Exception { InvalidStateError };
+ return Exception { InvalidStateError, "RTCPeerConnection is closed"_s };
+
+ if (!sender.isCreatedBy(*m_backend))
+ return Exception { InvalidAccessError, "RTCPeerConnection did not create the given sender"_s };
bool shouldAbort = true;
RTCRtpTransceiver* senderTransceiver = nullptr;
m_connection->getStats(*this, WTFMove(promise));
}
+bool RTCRtpSender::isCreatedBy(const PeerConnectionBackend& connection) const
+{
+ return &connection == m_connection.get();
+}
+
std::optional<RTCRtpCapabilities> RTCRtpSender::getCapabilities(ScriptExecutionContext& context, const String& kind)
{
return PeerConnectionBackend::senderCapabilities(context, kind);
void getStats(Ref<DeferredPromise>&&);
+ bool isCreatedBy(const PeerConnectionBackend&) const;
+
private:
RTCRtpSender(PeerConnectionBackend&, String&& trackKind, Vector<String>&& mediaStreamIds, std::unique_ptr<RTCRtpSenderBackend>&&);