OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 #if defined(WEBRTC_POSIX) | 10 #if defined(WEBRTC_POSIX) |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 622 |
623 // Force the socket server to assign the same port. | 623 // Force the socket server to assign the same port. |
624 ss_->SetNextPortForTesting(first_addr.port()); | 624 ss_->SetNextPortForTesting(first_addr.port()); |
625 turn_ready_ = false; | 625 turn_ready_ = false; |
626 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); | 626 CreateTurnPort(kTurnUsername, kTurnPassword, kTurnUdpProtoAddr); |
627 | 627 |
628 // It is expected that the turn port will first get a nonce from the server | 628 // It is expected that the turn port will first get a nonce from the server |
629 // using timestamp |ts_before| but then get an allocate mismatch error and | 629 // using timestamp |ts_before| but then get an allocate mismatch error and |
630 // receive an even newer nonce based on the system clock. |ts_before| is | 630 // receive an even newer nonce based on the system clock. |ts_before| is |
631 // chosen so that the two NONCEs generated by the server will be different. | 631 // chosen so that the two NONCEs generated by the server will be different. |
632 int64_t ts_before = rtc::Time64() - 1; | 632 int64_t ts_before = rtc::TimeMillis() - 1; |
633 std::string first_nonce = | 633 std::string first_nonce = |
634 turn_server_.server()->SetTimestampForNextNonce(ts_before); | 634 turn_server_.server()->SetTimestampForNextNonce(ts_before); |
635 turn_port_->PrepareAddress(); | 635 turn_port_->PrepareAddress(); |
636 | 636 |
637 EXPECT_TRUE_WAIT(turn_ready_, kTimeout); | 637 EXPECT_TRUE_WAIT(turn_ready_, kTimeout); |
638 EXPECT_NE(first_nonce, turn_port_->nonce()); | 638 EXPECT_NE(first_nonce, turn_port_->nonce()); |
639 } | 639 } |
640 | 640 |
641 // Tests that a new local address is created after | 641 // Tests that a new local address is created after |
642 // STUN_ERROR_ALLOCATION_MISMATCH. | 642 // STUN_ERROR_ALLOCATION_MISMATCH. |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 turn_port_->PrepareAddress(); | 1049 turn_port_->PrepareAddress(); |
1050 ASSERT_TRUE_WAIT(turn_error_, kResolverTimeout); | 1050 ASSERT_TRUE_WAIT(turn_error_, kResolverTimeout); |
1051 EXPECT_TRUE(turn_port_->Candidates().empty()); | 1051 EXPECT_TRUE(turn_port_->Candidates().empty()); |
1052 turn_port_.reset(); | 1052 turn_port_.reset(); |
1053 rtc::Thread::Current()->Post(this, MSG_TESTFINISH); | 1053 rtc::Thread::Current()->Post(this, MSG_TESTFINISH); |
1054 // Waiting for above message to be processed. | 1054 // Waiting for above message to be processed. |
1055 ASSERT_TRUE_WAIT(test_finish_, kTimeout); | 1055 ASSERT_TRUE_WAIT(test_finish_, kTimeout); |
1056 EXPECT_EQ(last_fd_count, GetFDCount()); | 1056 EXPECT_EQ(last_fd_count, GetFDCount()); |
1057 } | 1057 } |
1058 #endif | 1058 #endif |
OLD | NEW |