Adds test for experimental remote estimate SDP negotiation.

Bug: webrtc:10742
Change-Id: I50d9caecda10c504cb4880c37475eeccd22c0855
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146705
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28670}
diff --git a/modules/rtp_rtcp/source/rtcp_packet/remote_estimate.h b/modules/rtp_rtcp/source/rtcp_packet/remote_estimate.h
index a63b624..ebf7fef 100644
--- a/modules/rtp_rtcp/source/rtcp_packet/remote_estimate.h
+++ b/modules/rtp_rtcp/source/rtcp_packet/remote_estimate.h
@@ -32,6 +32,9 @@
 // overhead of the serializer every time RemoteEstimate is created.
 const RemoteEstimateSerializer* GetRemoteEstimateSerializer();
 
+// The RemoteEstimate packet provides network estimation results from the
+// receive side. This functionality is experimental and subject to change
+// without notice.
 class RemoteEstimate : public App {
  public:
   RemoteEstimate();
diff --git a/pc/session_description.h b/pc/session_description.h
index 229d331..99e78d8 100644
--- a/pc/session_description.h
+++ b/pc/session_description.h
@@ -113,6 +113,8 @@
     rtcp_reduced_size_ = reduced_size;
   }
 
+  // Indicates support for the remote network estimate packet type. This
+  // functionality is experimental and subject to change without notice.
   virtual bool remote_estimate() const { return remote_estimate_; }
   virtual void set_remote_estimate(bool remote_estimate) {
     remote_estimate_ = remote_estimate;
diff --git a/pc/webrtc_sdp_unittest.cc b/pc/webrtc_sdp_unittest.cc
index bbf28c9..3a105b8 100644
--- a/pc/webrtc_sdp_unittest.cc
+++ b/pc/webrtc_sdp_unittest.cc
@@ -3232,6 +3232,25 @@
   EXPECT_TRUE(video->conference_mode());
 }
 
+TEST_F(WebRtcSdpTest, SerializeAndDeserializeRemoteNetEstimate) {
+  {
+    // By default remote estimates are disabled.
+    JsepSessionDescription dst(kDummyType);
+    SdpDeserialize(webrtc::SdpSerialize(jdesc_), &dst);
+    EXPECT_FALSE(cricket::GetFirstVideoContentDescription(dst.description())
+                     ->remote_estimate());
+  }
+  {
+    // When remote estimate is enabled, the setting is propagated via SDP.
+    cricket::GetFirstVideoContentDescription(jdesc_.description())
+        ->set_remote_estimate(true);
+    JsepSessionDescription dst(kDummyType);
+    SdpDeserialize(webrtc::SdpSerialize(jdesc_), &dst);
+    EXPECT_TRUE(cricket::GetFirstVideoContentDescription(dst.description())
+                    ->remote_estimate());
+  }
+}
+
 TEST_F(WebRtcSdpTest, DeserializeBrokenSdp) {
   const char kSdpDestroyer[] = "!@#$%^&";
   const char kSdpEmptyType[] = " =candidate";