| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 rtc::scoped_ptr<TestVirtualSocketServer> ext_vss_; | 349 rtc::scoped_ptr<TestVirtualSocketServer> ext_vss_; |
| 350 rtc::scoped_ptr<Thread> int_thread_; | 350 rtc::scoped_ptr<Thread> int_thread_; |
| 351 rtc::scoped_ptr<Thread> ext_thread_; | 351 rtc::scoped_ptr<Thread> ext_thread_; |
| 352 rtc::scoped_ptr<NATServer> nat_; | 352 rtc::scoped_ptr<NATServer> nat_; |
| 353 rtc::scoped_ptr<NATSocketFactory> natsf_; | 353 rtc::scoped_ptr<NATSocketFactory> natsf_; |
| 354 rtc::scoped_ptr<AsyncSocket> client_; | 354 rtc::scoped_ptr<AsyncSocket> client_; |
| 355 rtc::scoped_ptr<AsyncSocket> server_; | 355 rtc::scoped_ptr<AsyncSocket> server_; |
| 356 rtc::scoped_ptr<AsyncSocket> accepted_; | 356 rtc::scoped_ptr<AsyncSocket> accepted_; |
| 357 }; | 357 }; |
| 358 | 358 |
| 359 TEST_F(NatTcpTest, TestConnectOut) { | 359 TEST_F(NatTcpTest, DISABLED_TestConnectOut) { |
| 360 server_.reset(ext_vss_->CreateAsyncSocket(SOCK_STREAM)); | 360 server_.reset(ext_vss_->CreateAsyncSocket(SOCK_STREAM)); |
| 361 server_->Bind(ext_addr_); | 361 server_->Bind(ext_addr_); |
| 362 server_->Listen(5); | 362 server_->Listen(5); |
| 363 | 363 |
| 364 client_.reset(natsf_->CreateAsyncSocket(SOCK_STREAM)); | 364 client_.reset(natsf_->CreateAsyncSocket(SOCK_STREAM)); |
| 365 EXPECT_GE(0, client_->Bind(int_addr_)); | 365 EXPECT_GE(0, client_->Bind(int_addr_)); |
| 366 EXPECT_GE(0, client_->Connect(server_->GetLocalAddress())); | 366 EXPECT_GE(0, client_->Connect(server_->GetLocalAddress())); |
| 367 | 367 |
| 368 ConnectEvents(); | 368 ConnectEvents(); |
| 369 | 369 |
| 370 EXPECT_TRUE_WAIT(connected_, 1000); | 370 EXPECT_TRUE_WAIT(connected_, 1000); |
| 371 EXPECT_EQ(client_->GetRemoteAddress(), server_->GetLocalAddress()); | 371 EXPECT_EQ(client_->GetRemoteAddress(), server_->GetLocalAddress()); |
| 372 EXPECT_EQ(accepted_->GetRemoteAddress().ipaddr(), ext_addr_.ipaddr()); | 372 EXPECT_EQ(accepted_->GetRemoteAddress().ipaddr(), ext_addr_.ipaddr()); |
| 373 | 373 |
| 374 rtc::scoped_ptr<rtc::TestClient> in(CreateTCPTestClient(client_.release())); | 374 rtc::scoped_ptr<rtc::TestClient> in(CreateTCPTestClient(client_.release())); |
| 375 rtc::scoped_ptr<rtc::TestClient> out( | 375 rtc::scoped_ptr<rtc::TestClient> out( |
| 376 CreateTCPTestClient(accepted_.release())); | 376 CreateTCPTestClient(accepted_.release())); |
| 377 | 377 |
| 378 const char* buf = "test_packet"; | 378 const char* buf = "test_packet"; |
| 379 size_t len = strlen(buf); | 379 size_t len = strlen(buf); |
| 380 | 380 |
| 381 in->Send(buf, len); | 381 in->Send(buf, len); |
| 382 SocketAddress trans_addr; | 382 SocketAddress trans_addr; |
| 383 EXPECT_TRUE(out->CheckNextPacket(buf, len, &trans_addr)); | 383 EXPECT_TRUE(out->CheckNextPacket(buf, len, &trans_addr)); |
| 384 | 384 |
| 385 out->Send(buf, len); | 385 out->Send(buf, len); |
| 386 EXPECT_TRUE(in->CheckNextPacket(buf, len, &trans_addr)); | 386 EXPECT_TRUE(in->CheckNextPacket(buf, len, &trans_addr)); |
| 387 } | 387 } |
| 388 // #endif | 388 // #endif |
| OLD | NEW |