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

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

Issue 2677233002: Expose RTCPeerConnection.icegatheringstatechange. (Closed)
Patch Set: fix number of passing tests Created 3 years, 10 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
Index: chrome/test/data/webrtc/peerconnection.js
diff --git a/chrome/test/data/webrtc/peerconnection.js b/chrome/test/data/webrtc/peerconnection.js
index 32a7587cc9890dd83b1b5735c3a99c8eefde905f..d236dc51303ae40b6170ca66954d0e2ebea9c268 100644
--- a/chrome/test/data/webrtc/peerconnection.js
+++ b/chrome/test/data/webrtc/peerconnection.js
@@ -17,6 +17,12 @@ var gPeerConnection = null;
var gIceCandidates = [];
/**
+ * This stores last ICE gathering state emitted on this side.
+ * @private
+ */
+var gIceGatheringState = 'no-gathering-state';
+
+/**
* Keeps track of whether we have seen crypto information in the SDP.
* @private
*/
@@ -417,6 +423,13 @@ function measureGetStatsCallbackPerformance() {
});
}
+/**
+ * Returns the last iceGatheringState emitted from icegatheringstatechange.
+ */
+function getLastGatheringState() {
+ returnToTest(gIceGatheringState);
+}
+
// Internals.
/** @private */
@@ -429,6 +442,7 @@ function createPeerConnection_(rtcConfig) {
peerConnection.onaddstream = addStreamCallback_;
peerConnection.onremovestream = removeStreamCallback_;
peerConnection.onicecandidate = iceCallback_;
+ peerConnection.onicegatheringstatechange = iceGatheringCallback_;
return peerConnection;
}
@@ -446,6 +460,12 @@ function iceCallback_(event) {
}
/** @private */
+function iceGatheringCallback_() {
+ gIceGatheringState = peerConnection.iceGatheringState;
+}
+
+
+/** @private */
function setLocalDescription(peerConnection, sessionDescription) {
if (sessionDescription.sdp.search('a=crypto') != -1 ||
sessionDescription.sdp.search('a=fingerprint') != -1)

Powered by Google App Engine
This is Rietveld 408576698