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

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

Issue 2951713002: RTCPeerConnection.addTrack and removeTrack added (behind flag) (Closed)
Patch Set: Addressed deadbeef's comments Created 3 years, 5 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/test/data/webrtc/munge_sdp.js ('k') | chrome/test/data/webrtc/peerconnection_rtp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/webrtc/peerconnection.js
diff --git a/chrome/test/data/webrtc/peerconnection.js b/chrome/test/data/webrtc/peerconnection.js
index 22963b43f09fcf0a8b429b9be8a976bd40c1152b..c51ff1158ea276413502d85c325c3c459836fa90 100644
--- a/chrome/test/data/webrtc/peerconnection.js
+++ b/chrome/test/data/webrtc/peerconnection.js
@@ -46,6 +46,9 @@ var gDefaultVideoCodec = null;
*/
var gOpusDtx = false;
+/** @private */
+var gNegotiationNeededCount = 0;
+
// Public interface to tests. These are expected to be called with
// ExecuteJavascript invocations from the browser tests and will return answers
// through the DOM automation controller.
@@ -454,6 +457,17 @@ function getLastGatheringState() {
returnToTest(gIceGatheringState);
}
+/**
+ * Returns "ok-negotiation-count-is-" followed by the number of times
+ * onnegotiationneeded has fired. This will include any currently queued
+ * negotiationneeded events.
+ */
+function getNegotiationNeededCount() {
+ window.setTimeout(function() {
+ returnToTest('ok-negotiation-count-is-' + gNegotiationNeededCount);
+ }, 0);
+}
+
// Internals.
/** @private */
@@ -467,6 +481,7 @@ function createPeerConnection_(rtcConfig) {
peerConnection.onremovestream = removeStreamCallback_;
peerConnection.onicecandidate = iceCallback_;
peerConnection.onicegatheringstatechange = iceGatheringCallback_;
+ peerConnection.onnegotiationneeded = negotiationNeededCallback_;
return peerConnection;
}
@@ -488,6 +503,10 @@ function iceGatheringCallback_() {
gIceGatheringState = peerConnection.iceGatheringState;
}
+/** @private */
+function negotiationNeededCallback_() {
+ ++gNegotiationNeededCount;
+}
/** @private */
function setLocalDescription(peerConnection, sessionDescription) {
« no previous file with comments | « chrome/test/data/webrtc/munge_sdp.js ('k') | chrome/test/data/webrtc/peerconnection_rtp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698