Bug 1136252 - Part 2: Wait for less RTP in signaling_unittests. r=mt
authorByron Campen [:bwc] <docfaraday@gmail.com>
Fri, 06 Mar 2015 15:16:38 -0800
changeset 233551 77605be85deb84e950ee48335f981d4cf8933638
parent 233550 4ec8bb1c0cf8e7325d316bcf1516a0ee905446ef
child 233552 00ee5c75c36b5d5804d4ead837d181f30c194dd0
push id28417
push userryanvm@gmail.com
push dateFri, 13 Mar 2015 19:52:44 +0000
treeherdermozilla-central@977add19414a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmt
bugs1136252
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1136252 - Part 2: Wait for less RTP in signaling_unittests. r=mt
media/webrtc/signaling/test/signaling_unittests.cpp
--- a/media/webrtc/signaling/test/signaling_unittests.cpp
+++ b/media/webrtc/signaling/test/signaling_unittests.cpp
@@ -1403,26 +1403,26 @@ class SignalingAgent {
 
     mozilla::RefPtr<mozilla::MediaPipeline> pipeline =
       GetMediaPipeline((flags & PIPELINE_SEND), stream, video);
     ASSERT_TRUE(pipeline);
     ASSERT_EQ(pipeline->IsDoingRtcpMux(), !!(flags & PIPELINE_RTCP_MUX));
     // We cannot yet test send/recv with video.
     if (!(flags & PIPELINE_VIDEO)) {
       if (flags & PIPELINE_SEND) {
-        ASSERT_TRUE_WAIT(pipeline->rtp_packets_sent() >= 40 &&
+        ASSERT_TRUE_WAIT(pipeline->rtp_packets_sent() >= 4 &&
                          pipeline->rtcp_packets_received() >= 1,
                          kDefaultTimeout);
-        ASSERT_GE(pipeline->rtp_packets_sent(), 40);
+        ASSERT_GE(pipeline->rtp_packets_sent(), 4);
         ASSERT_GE(pipeline->rtcp_packets_received(), 1);
       } else {
-        ASSERT_TRUE_WAIT(pipeline->rtp_packets_received() >= 40 &&
+        ASSERT_TRUE_WAIT(pipeline->rtp_packets_received() >= 4 &&
                          pipeline->rtcp_packets_sent() >= 1,
                          kDefaultTimeout);
-        ASSERT_GE(pipeline->rtp_packets_received(), 40);
+        ASSERT_GE(pipeline->rtp_packets_received(), 4);
         ASSERT_GE(pipeline->rtcp_packets_sent(), 1);
       }
     }
 
 
     // Check feedback method for video
     if ((flags & PIPELINE_VIDEO) && !(flags & PIPELINE_SEND)) {
         mozilla::MediaSessionConduit *conduit = pipeline->Conduit();
@@ -2403,25 +2403,25 @@ TEST_P(SignalingTest, OfferAnswerVideoIn
   OfferOptions options;
   options.setInt32Option("OfferToReceiveAudio", 1);
   options.setInt32Option("OfferToReceiveVideo", 1);
   OfferAnswer(options, OFFER_AUDIO | ANSWER_AUDIO,
               SHOULD_SENDRECV_AUDIO | SHOULD_RECV_VIDEO,
               SHOULD_SENDRECV_AUDIO | SHOULD_INACTIVE_VIDEO);
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
   // Check that we wrote a bunch of data
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  //ASSERT_GE(a2_->GetPacketsSent(0), 40);
-  //ASSERT_GE(a1_->GetPacketsReceived(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  //ASSERT_GE(a2_->GetPacketsSent(0), 4);
+  //ASSERT_GE(a1_->GetPacketsReceived(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 TEST_P(SignalingTest, OfferAnswerBothInactive)
 {
   OfferOptions options;
   options.setInt32Option("OfferToReceiveAudio", 1);
   options.setInt32Option("OfferToReceiveVideo", 1);
   OfferAnswer(options, OFFER_NONE,
@@ -2607,28 +2607,28 @@ TEST_P(SignalingTest, OfferAnswerDontAdd
 
 TEST_P(SignalingTest, FullCall)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
-
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 40 &&
-                   a1_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
+
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 4 &&
+                   a1_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
   // Check that we wrote a bunch of data
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsSent(0), 40);
-  ASSERT_GE(a1_->GetPacketsReceived(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsSent(0), 4);
+  ASSERT_GE(a1_->GetPacketsReceived(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 
   // Check the low-level media pipeline
   // for RTP and RTCP flows
   // The first Local pipeline gets stored at 0
   a1_->CheckMediaPipeline(0, false, fRtcpMux ?
     PIPELINE_RTCP_MUX | PIPELINE_SEND :
     PIPELINE_SEND);
 
@@ -2638,28 +2638,28 @@ TEST_P(SignalingTest, FullCall)
 
 TEST_P(SignalingTest, RenegotiationOffererAddsTracks)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get received
-  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
   // Not really packets, but audio segments, happens later
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4, kDefaultTimeout * 2);
 
   // OFFER_AV causes a new stream + tracks to be added
   OfferAnswer(options, OFFER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some more data to get received
-  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(1) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(1) >= 4, kDefaultTimeout * 2);
   // Not really packets, but audio segments, happens later
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(1) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(1) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
   // Check the low-level media pipeline
   // for RTP and RTCP flows
   for (size_t i = 0; i < 2; ++i) {
     a2_->CheckMediaPipeline(i,
                             false,
@@ -2681,58 +2681,58 @@ TEST_P(SignalingTest, RenegotiationOffer
 
 TEST_P(SignalingTest, RenegotiationOffererRemovesTrack)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get received
-  ASSERT_TRUE_WAIT(a1_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
   // Not really packets, but audio segments, happens later
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 4, kDefaultTimeout * 2);
 
   int a2PacketsSent = a2_->GetPacketsSent(0);
   int a1PacketsReceived = a1_->GetPacketsReceived(0);
 
   a1_->RemoveTrack(0, false);
 
   OfferAnswer(options, OFFER_NONE,
               SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO,
               SHOULD_SEND_AUDIO | SHOULD_SENDRECV_VIDEO);
 
-  ASSERT_TRUE_WAIT(a1_->GetPacketsReceived(0) >= a1PacketsReceived + 40,
+  ASSERT_TRUE_WAIT(a1_->GetPacketsReceived(0) >= a1PacketsReceived + 4,
                    kDefaultTimeout * 2);
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= a2PacketsSent + 40,
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= a2PacketsSent + 4,
                    kDefaultTimeout * 2);
 
   CloseStreams();
 }
 
 TEST_P(SignalingTest, RenegotiationOffererReplacesTrack)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get received
-  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
   // Not really packets, but audio segments, happens later
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4, kDefaultTimeout * 2);
 
   a1_->RemoveTrack(0, false);
 
   // OFFER_AUDIO causes a new audio track to be added on both sides
   OfferAnswer(options, OFFER_AUDIO,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some more data to get received
-  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(1) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(1) >= 4, kDefaultTimeout * 2);
   // Not really packets, but audio segments, happens later
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(1) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(1) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
   // Check the low-level media pipeline
   // for RTP and RTCP flows
   a1_->CheckMediaPipeline(1, false, fRtcpMux ?
     PIPELINE_RTCP_MUX | PIPELINE_SEND :
     PIPELINE_SEND);
@@ -2758,19 +2758,19 @@ TEST_P(SignalingTest, RenegotiationOffer
 
   a1_->AddStream(DOMMediaStream::HINT_CONTENTS_AUDIO |
                  DOMMediaStream::HINT_CONTENTS_VIDEO, audio_stream);
 
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get received
-  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
   // Not really packets, but audio segments, happens later
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4, kDefaultTimeout * 2);
 
   a1_->CreateOffer(options, OFFER_NONE, SHOULD_SENDRECV_AV);
   a1_->SetLocal(TestObserver::OFFER, a1_->offer());
   std::string audioSwapped = SwapMsids(a1_->offer(), false);
   std::string audioAndVideoSwapped = SwapMsids(audioSwapped, true);
   std::cout << "Msids swapped: " << std::endl << audioAndVideoSwapped << std::endl;
   a2_->SetRemote(TestObserver::OFFER, audioAndVideoSwapped);
   Answer(options, OFFER_NONE, SHOULD_SENDRECV_AV, BOTH_TRICKLE);
@@ -2796,29 +2796,29 @@ TEST_P(SignalingTest, RenegotiationOffer
 
 TEST_P(SignalingTest, RenegotiationAnswererAddsTracks)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get received
-  ASSERT_TRUE_WAIT(a1_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
   // Not really packets, but audio segments, happens later
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 4, kDefaultTimeout * 2);
 
   options.setInt32Option("OfferToReceiveAudio", 2);
   options.setInt32Option("OfferToReceiveVideo", 2);
 
   // ANSWER_AV causes a new stream + tracks to be added
   OfferAnswer(options, ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
-  ASSERT_TRUE_WAIT(a1_->GetPacketsReceived(1) >= 40, kDefaultTimeout * 2);
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(1) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsReceived(1) >= 4, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(1) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
   // Check the low-level media pipeline
   // for RTP and RTCP flows
   for (size_t i = 0; i < 2; ++i) {
     a1_->CheckMediaPipeline(i,
                             false,
@@ -2840,67 +2840,67 @@ TEST_P(SignalingTest, RenegotiationAnswe
 
 TEST_P(SignalingTest, RenegotiationAnswererRemovesTrack)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get received
-  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
   // Not really packets, but audio segments, happens later
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4, kDefaultTimeout * 2);
 
   int a1PacketsSent = a1_->GetPacketsSent(0);
   int a2PacketsReceived = a2_->GetPacketsReceived(0);
 
   a2_->RemoveTrack(0, false);
 
   OfferAnswer(options, OFFER_NONE,
               SHOULD_SENDRECV_AUDIO | SHOULD_SENDRECV_VIDEO,
               SHOULD_RECV_AUDIO | SHOULD_SENDRECV_VIDEO);
 
-  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= a2PacketsReceived + 40,
+  ASSERT_TRUE_WAIT(a2_->GetPacketsReceived(0) >= a2PacketsReceived + 4,
                    kDefaultTimeout * 2);
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= a1PacketsSent + 40,
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= a1PacketsSent + 4,
                    kDefaultTimeout * 2);
 
   CloseStreams();
 }
 
 TEST_P(SignalingTest, RenegotiationAnswererReplacesTrack)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
-
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 40 &&
-                   a1_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
+
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 4 &&
+                   a1_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   int a1PacketsSent = a1_->GetPacketsSent(0);
   int a2PacketsReceived = a2_->GetPacketsReceived(0);
 
   a2_->RemoveTrack(0, false);
 
   // ANSWER_AUDIO causes a new audio track to be added
   OfferAnswer(options, ANSWER_AUDIO,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some more data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= a1PacketsSent + 40 &&
-                   a2_->GetPacketsReceived(0) >= a2PacketsReceived + 40,
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= a1PacketsSent + 4 &&
+                   a2_->GetPacketsReceived(0) >= a2PacketsReceived + 4,
                    kDefaultTimeout * 2);
 
   // The other direction is going to start over
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 40 &&
-                   a1_->GetPacketsReceived(0) >= 40,
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 4 &&
+                   a1_->GetPacketsReceived(0) >= 4,
                    kDefaultTimeout * 2);
 
   CloseStreams();
 
   // Check the low-level media pipeline
   // for RTP and RTCP flows
   a1_->CheckMediaPipeline(0, false, fRtcpMux ?
     PIPELINE_RTCP_MUX | PIPELINE_SEND :
@@ -2917,21 +2917,21 @@ TEST_P(SignalingTest, BundleRenegotiatio
     return;
   }
 
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
-
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 40 &&
-                   a1_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
+
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= 4 &&
+                   a1_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   int a1PacketsSent = a1_->GetPacketsSent(0);
   int a2PacketsSent = a2_->GetPacketsSent(0);
   int a1PacketsReceived = a1_->GetPacketsReceived(0);
   int a2PacketsReceived = a2_->GetPacketsReceived(0);
 
   // If we did bundle before, turn it off, if not, turn it on
   if (a1_->mBundleEnabled && a2_->mBundleEnabled) {
@@ -2940,22 +2940,22 @@ TEST_P(SignalingTest, BundleRenegotiatio
     a1_->SetBundleEnabled(true);
     a2_->SetBundleEnabled(true);
   }
 
   OfferAnswer(options, OFFER_NONE,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some more data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= a1PacketsSent + 40 &&
-                   a2_->GetPacketsReceived(0) >= a2PacketsReceived + 40,
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= a1PacketsSent + 4 &&
+                   a2_->GetPacketsReceived(0) >= a2PacketsReceived + 4,
                    kDefaultTimeout * 2);
 
-  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= a2PacketsSent + 40 &&
-                   a1_->GetPacketsReceived(0) >= a1PacketsReceived + 40,
+  ASSERT_TRUE_WAIT(a2_->GetPacketsSent(0) >= a2PacketsSent + 4 &&
+                   a1_->GetPacketsReceived(0) >= a1PacketsReceived + 4,
                    kDefaultTimeout * 2);
 
   // Check the low-level media pipeline
   // for RTP and RTCP flows
   // The first Local pipeline gets stored at 0
   a1_->CheckMediaPipeline(0, false, fRtcpMux ?
     PIPELINE_RTCP_MUX | PIPELINE_SEND :
     PIPELINE_SEND);
@@ -2966,73 +2966,73 @@ TEST_P(SignalingTest, BundleRenegotiatio
 
 TEST_P(SignalingTest, FullCallAudioOnly)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AUDIO | ANSWER_AUDIO,
               SHOULD_SENDRECV_AUDIO, SHOULD_SENDRECV_AUDIO);
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
   // Check that we wrote a bunch of data
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  //ASSERT_GE(a2_->GetPacketsSent(0), 40);
-  //ASSERT_GE(a1_->GetPacketsReceived(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  //ASSERT_GE(a2_->GetPacketsSent(0), 4);
+  //ASSERT_GE(a1_->GetPacketsReceived(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 // FIXME -- reject offered stream by .stop()ing the MST that was offered instead,
 // or by setting .active property to false on the created RTPReceiver object.
 TEST_P(SignalingTest, DISABLED_FullCallAnswererRejectsVideo)
 {
   OfferOptions offeroptions;
   OfferOptions answeroptions;
   answeroptions.setInt32Option("offerToReceiveAudio", 1);
   answeroptions.setInt32Option("offerToReceiveVideo", 0);
   OfferAnswer(offeroptions, OFFER_AV | ANSWER_AUDIO,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AUDIO);
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
   // Check that we wrote a bunch of data
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  //ASSERT_GE(a2_->GetPacketsSent(0), 40);
-  //ASSERT_GE(a1_->GetPacketsReceived(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  //ASSERT_GE(a2_->GetPacketsSent(0), 4);
+  //ASSERT_GE(a1_->GetPacketsReceived(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 TEST_P(SignalingTest, FullCallVideoOnly)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_VIDEO | ANSWER_VIDEO,
               SHOULD_SENDRECV_VIDEO | SHOULD_OMIT_AUDIO,
               SHOULD_SENDRECV_VIDEO | SHOULD_OMIT_AUDIO);
 
   // If we could check for video packets, we would wait for some to be written
   // here. Since we can't, we don't.
-  // ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-  //                 a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  // ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+  //                 a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
   // FIXME -- Ideally we would check that packets were sent
   // and received; however, the test driver setup does not
   // currently support sending/receiving with Fake_VideoStreamSource.
   //
   // Check that we wrote a bunch of data
-  // ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  //ASSERT_GE(a2_->GetPacketsSent(0), 40);
-  //ASSERT_GE(a1_->GetPacketsReceived(0), 40);
-  // ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  // ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  //ASSERT_GE(a2_->GetPacketsSent(0), 4);
+  //ASSERT_GE(a1_->GetPacketsReceived(0), 4);
+  // ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 TEST_P(SignalingTest, OfferAndAnswerWithExtraCodec)
 {
   EnsureInit();
   OfferOptions options;
   Offer(options, OFFER_AUDIO, SHOULD_SENDRECV_AUDIO);
 
@@ -3057,41 +3057,41 @@ TEST_P(SignalingTest, FullCallTrickle)
   OfferAnswer(options,
               OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV,
               SHOULD_SENDRECV_AV);
 
   std::cerr << "ICE handshake completed" << std::endl;
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 // Offer answer with trickle but with chrome-style candidates
 TEST_P(SignalingTest, DISABLED_FullCallTrickleChrome)
 {
   OfferOptions options;
   OfferAnswerTrickleChrome(options,
                            OFFER_AV | ANSWER_AV,
                            SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   std::cerr << "ICE handshake completed" << std::endl;
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 TEST_P(SignalingTest, FullCallTrickleBeforeSetLocal)
 {
   OfferOptions options;
   Offer(options, OFFER_AV | ANSWER_AV, SHOULD_SENDRECV_AV);
   // ICE will succeed even if one side fails to trickle, so we need to disable
   // one side before performing a test that might cause candidates to be
@@ -3101,22 +3101,22 @@ TEST_P(SignalingTest, FullCallTrickleBef
   // has called CreateAnswer/SetLocal (ie; the ICE stack is not running yet)
   a1_->WaitForGather();
   Answer(options, OFFER_AV | ANSWER_AV, SHOULD_SENDRECV_AV);
   WaitForCompleted();
 
   std::cerr << "ICE handshake completed" << std::endl;
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 // This test comes from Bug 810220
 TEST_P(SignalingTest, AudioOnlyG711Call)
 {
   EnsureInit();
 
   OfferOptions options;
@@ -3770,23 +3770,23 @@ TEST_P(SignalingTest, AudioOnlyCalleeNoR
 
   // Answer should not have a=rtcp-mux
   ASSERT_EQ(a2_->getLocalDescription().find("\r\na=rtcp-mux"),
             std::string::npos) << "SDP was: " << a2_->getLocalDescription();
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 
   // Check the low-level media pipeline
   // for RTP and RTCP flows
   // The first Local pipeline gets stored at 0
   a1_->CheckMediaPipeline(0, false, PIPELINE_SEND);
   a2_->CheckMediaPipeline(0, false, 0);
 }
 
@@ -3810,23 +3810,23 @@ TEST_P(SignalingTest, AudioOnlyG722Only)
   a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false);
   a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
   ASSERT_NE(a2_->getLocalDescription().find("RTP/SAVPF 9\r"), std::string::npos);
   ASSERT_NE(a2_->getLocalDescription().find("a=rtpmap:9 G722/8000"), std::string::npos);
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 TEST_P(SignalingTest, AudioOnlyG722MostPreferred)
 {
   EnsureInit();
 
   OfferOptions options;
 
@@ -3904,23 +3904,23 @@ TEST_P(SignalingTest, FullCallAudioNoMux
     ASSERT_NE(match, std::string::npos);
     match = a2_->getLocalDescription().find("\r\na=rtcp-mux", match + 1);
   }
   ASSERT_EQ(match, std::string::npos);
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 
   // Check the low-level media pipeline
   // for RTP and RTCP flows
   // The first Local pipeline gets stored at 0
   a1_->CheckMediaPipeline(0, false, PIPELINE_SEND);
 
   // Now check video mux.
   a1_->CheckMediaPipeline(0, true,
@@ -4106,23 +4106,23 @@ TEST_P(SignalingTest, AudioCallForceDtls
   // This should setup the DTLS with the same roles
   // as the regular tests above.
   a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false);
   a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 // In this test we will change the offer SDP's a=setup value
 // from actpass to active.  This will make the answer do passive
 TEST_P(SignalingTest, AudioCallReverseDtlsRoles)
 {
   EnsureInit();
 
@@ -4154,23 +4154,23 @@ TEST_P(SignalingTest, AudioCallReverseDt
   // This should setup the DTLS with the opposite roles
   // than the regular tests above.
   a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false);
   a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 // In this test we will change the answer SDP's a=setup value
 // from active to passive.  This will make both sides do
 // active and should not connect.
 TEST_P(SignalingTest, AudioCallMismatchDtlsRoles)
 {
   EnsureInit();
@@ -4206,17 +4206,17 @@ TEST_P(SignalingTest, AudioCallMismatchD
 
   WaitForCompleted();
 
   // Not using ASSERT_TRUE_WAIT here because we expect failure
   PR_Sleep(kDefaultTimeout * 2); // Wait for some data to get written
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
   // In this case we should receive nothing.
   ASSERT_EQ(a2_->GetPacketsReceived(0), 0);
 }
 
 // In this test we will change the offer SDP's a=setup value
 // from actpass to garbage.  It should ignore the garbage value
 // and respond with setup:active
 TEST_P(SignalingTest, AudioCallGarbageSetup)
@@ -4250,23 +4250,23 @@ TEST_P(SignalingTest, AudioCallGarbageSe
   // This should setup the DTLS with the same roles
   // as the regular tests above.
   a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false);
   a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 // In this test we will change the offer SDP to remove the
 // a=setup line.  Answer should respond with a=setup:active.
 TEST_P(SignalingTest, AudioCallOfferNoSetupOrConnection)
 {
   EnsureInit();
 
@@ -4297,23 +4297,23 @@ TEST_P(SignalingTest, AudioCallOfferNoSe
   // This should setup the DTLS with the same roles
   // as the regular tests above.
   a2_->SetLocal(TestObserver::ANSWER, a2_->answer(), false);
   a1_->SetRemote(TestObserver::ANSWER, a2_->answer(), false);
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 // In this test we will change the answer SDP to remove the
 // a=setup line.  ICE should still connect since active will
 // be assumed.
 TEST_P(SignalingTest, AudioCallAnswerNoSetupOrConnection)
 {
   EnsureInit();
@@ -4344,58 +4344,58 @@ TEST_P(SignalingTest, AudioCallAnswerNoS
   // This should setup the DTLS with the same roles
   // as the regular tests above.
   a2_->SetLocal(TestObserver::ANSWER, answer, false);
   a1_->SetRemote(TestObserver::ANSWER, answer, false);
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 
 TEST_P(SignalingTest, FullCallRealTrickle)
 {
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 TEST_P(SignalingTest, FullCallRealTrickleTestServer)
 {
   SetTestStunServer();
 
   OfferOptions options;
   OfferAnswer(options, OFFER_AV | ANSWER_AV,
               SHOULD_SENDRECV_AV, SHOULD_SENDRECV_AV);
 
   TestStunServer::GetInstance()->SetActive(true);
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
-  ASSERT_GE(a1_->GetPacketsSent(0), 40);
-  ASSERT_GE(a2_->GetPacketsReceived(0), 40);
+  ASSERT_GE(a1_->GetPacketsSent(0), 4);
+  ASSERT_GE(a2_->GetPacketsReceived(0), 4);
 }
 
 TEST_P(SignalingTest, hugeSdp)
 {
   EnsureInit();
 
   OfferOptions options;
   std::string offer =
@@ -4954,18 +4954,18 @@ TEST_P(SignalingTest, UseNonPrefferedPay
   a1_->SetRemote(TestObserver::ANSWER, answer, false);
 
   ASSERT_EQ(a1_->pObserver->lastStatusCode,
             PeerConnectionImpl::kNoError);
 
   WaitForCompleted();
 
   // Wait for some data to get written
-  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 40 &&
-                   a2_->GetPacketsReceived(0) >= 40, kDefaultTimeout * 2);
+  ASSERT_TRUE_WAIT(a1_->GetPacketsSent(0) >= 4 &&
+                   a2_->GetPacketsReceived(0) >= 4, kDefaultTimeout * 2);
 
   CloseStreams();
 }
 
 TEST_P(SignalingTest, VideoNegotiationFails)
 {
   EnsureInit();