Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5670)

Unified Diff: chrome/test/data/webrtc/peerconnection_rtp.js

Issue 2749703005: RTCRtpSender with track behind RuntimeEnabled flag (Closed)
Patch Set: external/wpt/webrtc/RTCPeerConnection-idl-expected.txt updated passing 2 more tests Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/webrtc/webrtc_rtp_browsertest.cc ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/peerconnection_rtp.js
diff --git a/chrome/test/data/webrtc/peerconnection_rtp.js b/chrome/test/data/webrtc/peerconnection_rtp.js
index 755c0972ad92fd4950f3c52b71e92a59a3065325..49962de83fd3615a8b986c5eedbabacba18f1566 100644
--- a/chrome/test/data/webrtc/peerconnection_rtp.js
+++ b/chrome/test/data/webrtc/peerconnection_rtp.js
@@ -30,6 +30,51 @@ function createAndAddStreams(count) {
}
/**
+ * Verifies that the peer connection's getSenders() returns one sender per local
+ * track, that there are no duplicates and that object identity is preserved.
+ *
+ * Returns "ok-senders-verified" on success.
+ */
+function verifyRtpSenders(expectedNumTracks = null) {
+ if (expectedNumTracks != null &&
+ peerConnection_().getSenders().length != expectedNumTracks) {
+ throw failTest('getSenders().length != expectedNumTracks');
+ }
+ if (!arrayEquals_(peerConnection_().getSenders(),
+ peerConnection_().getSenders())) {
+ throw failTest('One getSenders() call is not equal to the next.');
+ }
+
+ let localTracks = new Set();
+ peerConnection_().getLocalStreams().forEach(function(stream) {
+ stream.getTracks().forEach(function(track) {
+ localTracks.add(track);
+ });
+ });
+ if (peerConnection_().getSenders().length != localTracks.size)
+ throw failTest('The number of senders and tracks are not the same.');
+
+ let senders = new Set();
+ let senderTracks = new Set();
+ peerConnection_().getSenders().forEach(function(sender) {
+ if (sender == null)
+ throw failTest('sender is null or undefined.');
+ if (sender.track == null)
+ throw failTest('sender.track is null or undefined.');
+ senders.add(sender);
+ senderTracks.add(sender.track);
+ });
+ if (senderTracks.size != senders.size)
+ throw failTest('senderTracks.size != senders.size');
+
+ if (!setEquals_(senderTracks, localTracks)) {
+ throw failTest('The set of sender tracks is not equal to the set of ' +
+ 'stream tracks.');
+ }
+ returnToTest('ok-senders-verified');
+}
+
+/**
* Verifies that the peer connection's getReceivers() returns one receiver per
* remote track, that there are no duplicates and that object identity is
* preserved.
« no previous file with comments | « chrome/browser/media/webrtc/webrtc_rtp_browsertest.cc ('k') | content/renderer/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698