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

Unified Diff: talk/app/webrtc/webrtcsdp_unittest.cc

Issue 1196403004: Prevent JS from bypassing RTP data channel bandwidth limitation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removing accidentally copied line Created 5 years, 6 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
« talk/app/webrtc/webrtcsdp.cc ('K') | « talk/app/webrtc/webrtcsdp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/app/webrtc/webrtcsdp_unittest.cc
diff --git a/talk/app/webrtc/webrtcsdp_unittest.cc b/talk/app/webrtc/webrtcsdp_unittest.cc
index 2bd6f6d668951d8d16f782142ef55e921ce47ed6..50ea8b0137b8bf4f8b8950f74c25e3da2a013f94 100644
--- a/talk/app/webrtc/webrtcsdp_unittest.cc
+++ b/talk/app/webrtc/webrtcsdp_unittest.cc
@@ -1698,12 +1698,7 @@ TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithDataChannelAndBandwidth) {
std::string expected_sdp = kSdpString;
expected_sdp.append(kSdpRtpDataChannelString);
- // We want to test that serializing data content ignores bandwidth
- // settings (it should always be the default). Thus, we don't do
- // the following:
- // TODO(pthatcher): We need to temporarily allow the SDP to control
- // this for backwards-compatibility. Once we don't need that any
- // more, remove this.
+ // Serializing data content shouldn't ignore bandwidth settings.
InjectAfter("m=application 9 RTP/SAVPF 101\r\nc=IN IP4 0.0.0.0\r\n",
"b=AS:100\r\n",
&expected_sdp);
@@ -2261,12 +2256,10 @@ TEST_F(WebRtcSdpTest, DeserializeSdpWithSctpDataChannelAndNewPort) {
TEST_F(WebRtcSdpTest, DeserializeSdpWithRtpDataChannelsAndBandwidth) {
AddRtpDataChannel();
JsepSessionDescription jdesc(kDummyString);
- // We want to test that deserializing data content ignores bandwidth
- // settings (it should always be the default). Thus, we don't do
- // the following:
- // TODO(pthatcher): We need to temporarily allow the SDP to control
- // this for backwards-compatibility. Once we don't need that any
- // more, remove this.
+ // We want to test that deserializing data content limits bandwidth
+ // settings (it should never be greater than the default).
+ // This should prevent someone from using unlimited data bandwidth through
+ // JS and "breaking the Internet".
DataContentDescription* dcd = static_cast<DataContentDescription*>(
GetFirstDataContent(&desc_)->description);
dcd->set_bandwidth(100 * 1000);
@@ -2279,9 +2272,7 @@ TEST_F(WebRtcSdpTest, DeserializeSdpWithRtpDataChannelsAndBandwidth) {
&sdp_with_bandwidth);
JsepSessionDescription jdesc_with_bandwidth(kDummyString);
- EXPECT_TRUE(
- SdpDeserialize(sdp_with_bandwidth, &jdesc_with_bandwidth));
- EXPECT_TRUE(CompareSessionDescription(jdesc, jdesc_with_bandwidth));
+ EXPECT_FALSE(SdpDeserialize(sdp_with_bandwidth, &jdesc_with_bandwidth));
}
TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithSessionLevelExtmap) {
« talk/app/webrtc/webrtcsdp.cc ('K') | « talk/app/webrtc/webrtcsdp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698