Lines Matching refs:ch2
574 void ConnectStartedChannels(TestChannel* ch1, TestChannel* ch2) { in ConnectStartedChannels() argument
578 WAIT(!ch2->remote_address().IsNil(), kTimeout); in ConnectStartedChannels()
581 ch2->AcceptConnection(GetCandidate(ch1->port())); in ConnectStartedChannels()
582 ch2->Ping(); in ConnectStartedChannels()
583 EXPECT_EQ_WAIT(Connection::STATE_WRITABLE, ch2->conn()->write_state(), in ConnectStartedChannels()
590 void StartConnectAndStopChannels(TestChannel* ch1, TestChannel* ch2) { in StartConnectAndStopChannels() argument
593 ch2->Start(); in StartConnectAndStopChannels()
595 ch1->CreateConnection(GetCandidate(ch2->port())); in StartConnectAndStopChannels()
596 ConnectStartedChannels(ch1, ch2); in StartConnectAndStopChannels()
600 ch2->Stop(); in StartConnectAndStopChannels()
605 void DisconnectTcpTestChannels(TestChannel* ch1, TestChannel* ch2) { in DisconnectTcpTestChannels() argument
607 TCPConnection* tcp_conn2 = static_cast<TCPConnection*>(ch2->conn()); in DisconnectTcpTestChannels()
614 EXPECT_TRUE_WAIT(!ch2->conn()->connected(), kTimeout); in DisconnectTcpTestChannels()
624 ch2->conn()->Destroy(); in DisconnectTcpTestChannels()
625 EXPECT_TRUE_WAIT(ch2->conn() == NULL, kTimeout); in DisconnectTcpTestChannels()
640 TestChannel ch2(port2); in TestTcpReconnect() local
642 EXPECT_EQ(0, ch2.complete_count()); in TestTcpReconnect()
645 ch2.Start(); in TestTcpReconnect()
647 ASSERT_EQ_WAIT(1, ch2.complete_count(), kTimeout); in TestTcpReconnect()
651 ConnectStartedChannels(&ch1, &ch2); in TestTcpReconnect()
657 static_cast<TCPConnection*>(ch2.conn()) in TestTcpReconnect()
661 EXPECT_FALSE(ch2.connection_ready_to_send()); in TestTcpReconnect()
664 DisconnectTcpTestChannels(&ch1, &ch2); in TestTcpReconnect()
682 ConnectStartedChannels(&ch1, &ch2); in TestTcpReconnect()
688 EXPECT_FALSE(ch2.connection_ready_to_send()); in TestTcpReconnect()
694 EXPECT_TRUE(!ch2.conn()); in TestTcpReconnect()
699 ch2.Stop(); in TestTcpReconnect()
701 EXPECT_TRUE_WAIT(ch2.conn() == NULL, kTimeout); in TestTcpReconnect()
789 TestChannel ch2(port2); in TestConnectivity() local
791 EXPECT_EQ(0, ch2.complete_count()); in TestConnectivity()
795 ch2.Start(); in TestConnectivity()
797 ASSERT_EQ_WAIT(1, ch2.complete_count(), kTimeout); in TestConnectivity()
804 WAIT(!ch2.remote_address().IsNil(), kTimeout); in TestConnectivity()
810 EXPECT_EQ(ch2.remote_fragment(), port1->username_fragment()); in TestConnectivity()
814 if (same_addr1) EXPECT_EQ(ch2.remote_address(), GetAddress(port1)); in TestConnectivity()
818 ch2.AcceptConnection(GetCandidate(port1)); in TestConnectivity()
819 ASSERT_TRUE(ch2.conn() != NULL); in TestConnectivity()
820 ch2.Ping(); in TestConnectivity()
821 EXPECT_EQ_WAIT(Connection::STATE_WRITABLE, ch2.conn()->write_state(), in TestConnectivity()
827 EXPECT_TRUE(ch2.remote_address().IsNil()); in TestConnectivity()
830 ch2.CreateConnection(GetCandidate(port1)); in TestConnectivity()
831 ASSERT_TRUE(ch2.conn() != NULL); in TestConnectivity()
832 ch2.Ping(); in TestConnectivity()
833 WAIT(ch2.conn()->write_state() == Connection::STATE_WRITABLE, kTimeout); in TestConnectivity()
838 EXPECT_EQ(Connection::STATE_WRITABLE, ch2.conn()->write_state()); in TestConnectivity()
851 EXPECT_TRUE(ch2.remote_address().IsNil()); in TestConnectivity()
856 EXPECT_TRUE_WAIT(!ch2.remote_address().IsNil(), kTimeout); in TestConnectivity()
857 EXPECT_FALSE(ch2.conn()->receiving()); in TestConnectivity()
861 ch2.AcceptConnection(GetCandidate(port1)); in TestConnectivity()
862 ASSERT_TRUE(ch2.conn() != NULL); in TestConnectivity()
863 ch2.Ping(); in TestConnectivity()
864 EXPECT_EQ_WAIT(Connection::STATE_WRITABLE, ch2.conn()->write_state(), in TestConnectivity()
880 EXPECT_TRUE(ch2.remote_address().IsNil()); in TestConnectivity()
882 WAIT(!ch2.remote_address().IsNil(), kTimeout); in TestConnectivity()
884 EXPECT_TRUE(ch2.remote_address().IsNil()); in TestConnectivity()
890 ASSERT_TRUE(ch2.conn() != NULL); in TestConnectivity()
894 EXPECT_TRUE(ch2.conn()->receiving()); in TestConnectivity()
895 EXPECT_EQ(Connection::STATE_WRITABLE, ch2.conn()->write_state()); in TestConnectivity()
899 EXPECT_FALSE(ch2.conn()->receiving()); in TestConnectivity()
900 EXPECT_NE(Connection::STATE_WRITABLE, ch2.conn()->write_state()); in TestConnectivity()
905 ch2.Stop(); in TestConnectivity()
907 EXPECT_TRUE_WAIT(ch2.conn() == NULL, kTimeout); in TestConnectivity()
1255 TestChannel ch2(port2); in TEST_F() local
1258 ch2.Start(); in TEST_F()
1260 ASSERT_EQ_WAIT(1, ch2.complete_count(), kTimeout); in TEST_F()
2269 TestChannel ch2(port2); in TEST_F() local
2273 ch2.Start(); in TEST_F()
2275 ASSERT_EQ_WAIT(1, ch2.complete_count(), kTimeout); in TEST_F()
2283 WAIT(!ch2.remote_address().IsNil(), kTimeout); in TEST_F()
2293 ch2.AcceptConnection(GetCandidate(port1)); in TEST_F()
2329 ch2.Stop(); in TEST_F()
2340 TestChannel ch2(port2); in TEST_F() local
2344 ch2.Start(); in TEST_F()
2439 TestChannel ch2(port2); in TEST_F() local
2442 StartConnectAndStopChannels(&ch1, &ch2); in TEST_F()
2470 TestChannel ch2(port2); in TEST_F() local
2473 StartConnectAndStopChannels(&ch1, &ch2); in TEST_F()
2500 TestChannel ch2(port2); in TEST_F() local
2503 StartConnectAndStopChannels(&ch1, &ch2); in TEST_F()
2505 EXPECT_TRUE_WAIT(ch2.conn() == nullptr, kTimeout); in TEST_F()