From c5137786511bbfda4355c7293aef43f50cd62273 Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Tue, 6 Oct 2015 15:07:19 -0500 Subject: [PATCH] Bug 1208176 - Part 2: Add a one-sided trickle test case to ice_unittest. r=drno --HG-- extra : rebase_source : 24f6c0d825a2f0fc161197c0143e0808c6df67f2 --- media/mtransport/test/ice_unittest.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/media/mtransport/test/ice_unittest.cpp b/media/mtransport/test/ice_unittest.cpp index ac337c422c29..6491211638ed 100644 --- a/media/mtransport/test/ice_unittest.cpp +++ b/media/mtransport/test/ice_unittest.cpp @@ -2457,6 +2457,10 @@ void DelayRelayCandidates( } } +void DropTrickleCandidates( + std::vector& candidates) { +} + TEST_F(IceConnectTest, TestConnectTrickleAddStreamDuringICE) { AddStream("first", 1); ASSERT_TRUE(Gather()); @@ -2506,6 +2510,26 @@ TEST_F(IceConnectTest, RemoveStream) { ConnectTrickle(); } +TEST_F(IceConnectTest, P1NoTrickle) { + AddStream("first", 1); + ASSERT_TRUE(Gather()); + ConnectTrickle(); + DropTrickleCandidates(p1_->ControlTrickle(0)); + RealisticTrickleDelay(p2_->ControlTrickle(0)); + ASSERT_TRUE_WAIT(p1_->ice_complete(), 1000); + ASSERT_TRUE_WAIT(p2_->ice_complete(), 1000); +} + +TEST_F(IceConnectTest, P2NoTrickle) { + AddStream("first", 1); + ASSERT_TRUE(Gather()); + ConnectTrickle(); + RealisticTrickleDelay(p1_->ControlTrickle(0)); + DropTrickleCandidates(p2_->ControlTrickle(0)); + ASSERT_TRUE_WAIT(p1_->ice_complete(), 1000); + ASSERT_TRUE_WAIT(p2_->ice_complete(), 1000); +} + TEST_F(IceConnectTest, RemoveAndAddStream) { AddStream("first", 1); AddStream("second", 1);