Bug 1220441 - Improve gather trickle ice unit tests. r=bwc r=mjf

--HG--
extra : transplant_source : %60%F7%F7%11%21%C1%10L%19u%C4M%11%40%E6%0F%D9%0AO%C5
This commit is contained in:
Nils Ohlmeier [:drno] 2015-11-02 14:57:30 -08:00
Родитель 85550613ed
Коммит 8420475130
1 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -2001,10 +2001,9 @@ TEST_F(IceGatherTest, TestStunServerReturnsLoopbackAddrV6) {
TEST_F(IceGatherTest, TestStunServerTrickle) { TEST_F(IceGatherTest, TestStunServerTrickle) {
UseFakeStunUdpServerWithResponse("192.0.2.1", 3333); UseFakeStunUdpServerWithResponse("192.0.2.1", 3333);
TestStunServer::GetInstance(AF_INET)->SetActive(false); TestStunServer::GetInstance(AF_INET)->SetDropInitialPackets(3);
Gather(0); Gather(0);
ASSERT_FALSE(StreamHasMatchingCandidate(0, "192.0.2.1")); ASSERT_FALSE(StreamHasMatchingCandidate(0, "192.0.2.1"));
TestStunServer::GetInstance(AF_INET)->SetActive(true);
WaitForGather(); WaitForGather();
ASSERT_TRUE(StreamHasMatchingCandidate(0, "192.0.2.1")); ASSERT_TRUE(StreamHasMatchingCandidate(0, "192.0.2.1"));
} }
@ -2042,23 +2041,20 @@ TEST_F(IceGatherTest, TestFakeStunServerNoNatDefaultRouteOnly) {
TEST_F(IceGatherTest, TestStunTcpServerTrickle) { TEST_F(IceGatherTest, TestStunTcpServerTrickle) {
UseFakeStunTcpServerWithResponse("192.0.3.1", 3333); UseFakeStunTcpServerWithResponse("192.0.3.1", 3333);
TestStunTcpServer::GetInstance(AF_INET)->SetActive(false); TestStunServer::GetInstance(AF_INET)->SetDelay(500);
Gather(0); Gather(0);
ASSERT_FALSE(StreamHasMatchingCandidate(0, " 192.0.3.1 ", " tcptype ")); ASSERT_FALSE(StreamHasMatchingCandidate(0, " 192.0.3.1 ", " tcptype "));
TestStunTcpServer::GetInstance(AF_INET)->SetActive(true);
WaitForGather(); WaitForGather();
ASSERT_TRUE(StreamHasMatchingCandidate(0, " 192.0.3.1 ", " tcptype ")); ASSERT_TRUE(StreamHasMatchingCandidate(0, " 192.0.3.1 ", " tcptype "));
} }
TEST_F(IceGatherTest, TestStunTcpAndUdpServerTrickle) { TEST_F(IceGatherTest, TestStunTcpAndUdpServerTrickle) {
UseFakeStunUdpTcpServersWithResponse("192.0.2.1", 3333, "192.0.3.1", 3333); UseFakeStunUdpTcpServersWithResponse("192.0.2.1", 3333, "192.0.3.1", 3333);
TestStunServer::GetInstance(AF_INET)->SetActive(false); TestStunServer::GetInstance(AF_INET)->SetDropInitialPackets(3);
TestStunTcpServer::GetInstance(AF_INET)->SetActive(false); TestStunTcpServer::GetInstance(AF_INET)->SetDelay(500);
Gather(0); Gather(0);
ASSERT_FALSE(StreamHasMatchingCandidate(0, "192.0.2.1", "UDP")); ASSERT_FALSE(StreamHasMatchingCandidate(0, "192.0.2.1", "UDP"));
ASSERT_FALSE(StreamHasMatchingCandidate(0, " 192.0.3.1 ", " tcptype ")); ASSERT_FALSE(StreamHasMatchingCandidate(0, " 192.0.3.1 ", " tcptype "));
TestStunServer::GetInstance(AF_INET)->SetActive(true);
TestStunTcpServer::GetInstance(AF_INET)->SetActive(true);
WaitForGather(); WaitForGather();
ASSERT_TRUE(StreamHasMatchingCandidate(0, "192.0.2.1", "UDP")); ASSERT_TRUE(StreamHasMatchingCandidate(0, "192.0.2.1", "UDP"));
ASSERT_TRUE(StreamHasMatchingCandidate(0, " 192.0.3.1 ", " tcptype ")); ASSERT_TRUE(StreamHasMatchingCandidate(0, " 192.0.3.1 ", " tcptype "));