| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2009 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 // Add server addresses to the relay port and let it start. | 146 // Add server addresses to the relay port and let it start. |
| 147 relay_port_->AddServerAddress( | 147 relay_port_->AddServerAddress( |
| 148 cricket::ProtocolAddress(fake_protocol_address)); | 148 cricket::ProtocolAddress(fake_protocol_address)); |
| 149 relay_port_->AddServerAddress( | 149 relay_port_->AddServerAddress( |
| 150 cricket::ProtocolAddress(kRelayTcpAddr, cricket::PROTO_TCP)); | 150 cricket::ProtocolAddress(kRelayTcpAddr, cricket::PROTO_TCP)); |
| 151 relay_port_->PrepareAddress(); | 151 relay_port_->PrepareAddress(); |
| 152 | 152 |
| 153 EXPECT_FALSE(relay_port_->IsReady()); | 153 EXPECT_FALSE(relay_port_->IsReady()); |
| 154 | 154 |
| 155 // Should have timed out in 200 + 200 + 400 + 800 + 1600 ms. | 155 // Should have timed out in 200 + 200 + 400 + 800 + 1600 ms = 3200ms. |
| 156 EXPECT_TRUE_WAIT(HasFailed(&fake_protocol_address), 3600); | 156 // Add some margin of error for slow bots. |
| 157 // TODO(deadbeef): Use simulated clock instead of just increasing timeouts |
| 158 // to fix flaky tests. |
| 159 EXPECT_TRUE_WAIT(HasFailed(&fake_protocol_address), 5000); |
| 157 | 160 |
| 158 // Wait until relayport is ready. | 161 // Wait until relayport is ready. |
| 159 EXPECT_TRUE_WAIT(relay_port_->IsReady(), kMaxTimeoutMs); | 162 EXPECT_TRUE_WAIT(relay_port_->IsReady(), kMaxTimeoutMs); |
| 160 | 163 |
| 161 // Should have only one connection. | 164 // Should have only one connection. |
| 162 EXPECT_EQ(1, relay_server_->GetConnectionCount()); | 165 EXPECT_EQ(1, relay_server_->GetConnectionCount()); |
| 163 | 166 |
| 164 // Should be the TCP address. | 167 // Should be the TCP address. |
| 165 EXPECT_TRUE(relay_server_->HasConnection(kRelayTcpAddr)); | 168 EXPECT_TRUE(relay_server_->HasConnection(kRelayTcpAddr)); |
| 166 } | 169 } |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 TestConnectUdp(); | 266 TestConnectUdp(); |
| 264 } | 267 } |
| 265 | 268 |
| 266 TEST_F(RelayPortTest, ConnectTcp) { | 269 TEST_F(RelayPortTest, ConnectTcp) { |
| 267 TestConnectTcp(); | 270 TestConnectTcp(); |
| 268 } | 271 } |
| 269 | 272 |
| 270 TEST_F(RelayPortTest, ConnectSslTcp) { | 273 TEST_F(RelayPortTest, ConnectSslTcp) { |
| 271 TestConnectSslTcp(); | 274 TestConnectSslTcp(); |
| 272 } | 275 } |
| OLD | NEW |