Commit 10dc9c96 authored by Philipp Hancke's avatar Philipp Hancke Committed by Commit Bot

webrtc-internals: detect SDP munging

show in the webrtc-internals page that you are using SDP munging
BUG=823036

Change-Id: I874bc4575f7718355336507d84c7616971c30e6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1953635
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Reviewed-by: default avatarHarald Alvestrand <hta@chromium.org>
Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737247}
parent 882334e6
...@@ -109,6 +109,14 @@ var PeerConnectionUpdateTable = (function() { ...@@ -109,6 +109,14 @@ var PeerConnectionUpdateTable = (function() {
if (candidateType) { if (candidateType) {
type += ' (' + candidateType[1] + ')'; type += ' (' + candidateType[1] + ')';
} }
} else if (
update.type === 'createOfferOnSuccess' ||
update.type === 'createAnswerOnSuccess') {
this.setLastOfferAnswer_(tableElement, update);
} else if (update.type === 'setLocalDescription') {
if (update.value !== this.getLastOfferAnswer_(tableElement)) {
type += ' (munged)';
}
} }
row.innerHTML += row.innerHTML +=
'<td><details><summary>' + type + '</summary></details></td>'; '<td><details><summary>' + type + '</summary></details></td>';
...@@ -186,6 +194,29 @@ var PeerConnectionUpdateTable = (function() { ...@@ -186,6 +194,29 @@ var PeerConnectionUpdateTable = (function() {
'<th class="update-log-header-event">Event</th></tr>'; '<th class="update-log-header-event">Event</th></tr>';
} }
return tableElement; return tableElement;
},
/**
* Store the last createOfferOnSuccess/createAnswerOnSuccess to compare to
* setLocalDescription and visualize SDP munging.
*
* @param {!Element} tableElement The peerconnection update element.
* @param {!PeerConnectionUpdateEntry} update The update to add.
* @private
*/
setLastOfferAnswer_: function(tableElement, update) {
tableElement['data-lastofferanswer'] = update.value;
},
/**
* Retrieves the last createOfferOnSuccess/createAnswerOnSuccess to compare
* to setLocalDescription and visualize SDP munging.
*
* @param {!Element} tableElement The peerconnection update element.
* @private
*/
getLastOfferAnswer_: function(tableElement) {
return tableElement['data-lastofferanswer'];
} }
}; };
......
...@@ -564,6 +564,8 @@ IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcInternalsBrowserTest, UpdatePeerConnection) { ...@@ -564,6 +564,8 @@ IN_PROC_BROWSER_TEST_F(MAYBE_WebRtcInternalsBrowserTest, UpdatePeerConnection) {
ExecuteAndVerifyUpdatePeerConnection(pc_2, "setRemoteDescription", ExecuteAndVerifyUpdatePeerConnection(pc_2, "setRemoteDescription",
ssrc1.GetSsrcAttributeString()); ssrc1.GetSsrcAttributeString());
ExecuteAndVerifyUpdatePeerConnection(pc_2, "createAnswerOnSuccess",
ssrc2.GetSsrcAttributeString());
ExecuteAndVerifyUpdatePeerConnection(pc_2, "setLocalDescription", ExecuteAndVerifyUpdatePeerConnection(pc_2, "setLocalDescription",
ssrc2.GetSsrcAttributeString()); ssrc2.GetSsrcAttributeString());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment