Chromium Code Reviews| Index: webrtc/p2p/base/turnport_unittest.cc |
| diff --git a/webrtc/p2p/base/turnport_unittest.cc b/webrtc/p2p/base/turnport_unittest.cc |
| index 724485ddde05b70fac6a1fc06331b74c4d058f7c..1f6045f18e8a654e2e19cc06b267f4c57bd50f04 100644 |
| --- a/webrtc/p2p/base/turnport_unittest.cc |
| +++ b/webrtc/p2p/base/turnport_unittest.cc |
| @@ -385,6 +385,24 @@ class TurnPortTest : public testing::Test, |
| EXPECT_TRUE(conn2->receiving()); |
| } |
| + void TestRefreshCreatePermissionRequest() { |
| + ASSERT_TRUE(turn_port_ != NULL); |
| + turn_port_->PrepareAddress(); |
| + ASSERT_TRUE_WAIT(turn_ready_, kTimeout); |
| + CreateUdpPort(); |
| + udp_port_->PrepareAddress(); |
| + ASSERT_TRUE_WAIT(udp_ready_, kTimeout); |
| + |
| + Connection* conn = turn_port_->CreateConnection(udp_port_->Candidates()[0], |
| + Port::ORIGIN_MESSAGE); |
| + ASSERT_TRUE(conn != NULL); |
| + ASSERT_TRUE_WAIT(turn_create_permission_success_, kTimeout); |
| + turn_create_permission_success_ = false; |
| + // A create-permission-request should be pending. |
| + turn_port_->FlushRequests(); |
| + ASSERT_TRUE_WAIT(turn_create_permission_success_, kTimeout); |
|
pthatcher1
2015/11/11 20:22:09
Unfortunately, this doesn't test *when* the permis
honghaiz3
2015/11/11 23:51:58
It is pretty hard to test that. We don't want to w
|
| + } |
| + |
| void TestTurnSendData() { |
| turn_port_->PrepareAddress(); |
| EXPECT_TRUE_WAIT(turn_ready_, kTimeout); |
| @@ -715,6 +733,13 @@ TEST_F(TurnPortTest, TestTurnConnectionUsingOTUNonce) { |
| TestTurnConnection(); |
| } |
| +// Test that CreatePermissionRequest will be scheduled after the success |
| +// of the first create permission request. |
| +TEST_F(TurnPortTest, TestRefreshCreatePermissionRequest) { |
| + CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); |
| + TestRefreshCreatePermissionRequest(); |
|
pthatcher1
2015/11/11 20:22:09
Why did you put this in a separate method? Why no
honghaiz3
2015/11/11 23:51:59
Done.
|
| +} |
| + |
| // Do a TURN allocation, establish a UDP connection, and send some data. |
| TEST_F(TurnPortTest, TestTurnSendDataTurnUdpToUdp) { |
| // Create ports and prepare addresses. |