Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(281)

Side by Side Diff: webrtc/api/webrtcsession_unittest.cc

Issue 2024813004: Improving the fake clock and using it to fix a flaky STUN timeout test. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/base/base_tests.gyp » ('j') | webrtc/base/gunit.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10
(...skipping 1488 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort)); 1499 AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
1500 AddInterface(rtc::SocketAddress(kClientAddrHost2, kClientAddrPort)); 1500 AddInterface(rtc::SocketAddress(kClientAddrHost2, kClientAddrPort));
1501 Init(); 1501 Init();
1502 SendAudioVideoStream1(); 1502 SendAudioVideoStream1();
1503 InitiateCall(); 1503 InitiateCall();
1504 EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout); 1504 EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout);
1505 EXPECT_EQ(8u, observer_.mline_0_candidates_.size()); 1505 EXPECT_EQ(8u, observer_.mline_0_candidates_.size());
1506 EXPECT_EQ(8u, observer_.mline_1_candidates_.size()); 1506 EXPECT_EQ(8u, observer_.mline_1_candidates_.size());
1507 } 1507 }
1508 1508
1509 // Crashes on Win only. See webrtc:5411. 1509 TEST_F(WebRtcSessionTest, TestStunError) {
1510 #if defined(WEBRTC_WIN) 1510 rtc::ScopedFakeClock sfc;
1511 #define MAYBE_TestStunError DISABLED_TestStunError 1511
1512 #else
1513 #define MAYBE_TestStunError TestStunError
1514 #endif
1515 TEST_F(WebRtcSessionTest, MAYBE_TestStunError) {
1516 AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort)); 1512 AddInterface(rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
1517 AddInterface(rtc::SocketAddress(kClientAddrHost2, kClientAddrPort)); 1513 AddInterface(rtc::SocketAddress(kClientAddrHost2, kClientAddrPort));
1518 fss_->AddRule(false, 1514 fss_->AddRule(false,
1519 rtc::FP_UDP, 1515 rtc::FP_UDP,
1520 rtc::FD_ANY, 1516 rtc::FD_ANY,
1521 rtc::SocketAddress(kClientAddrHost1, kClientAddrPort)); 1517 rtc::SocketAddress(kClientAddrHost1, kClientAddrPort));
1522 Init(); 1518 Init();
1523 SendAudioVideoStream1(); 1519 SendAudioVideoStream1();
1524 InitiateCall(); 1520 InitiateCall();
1525 // Since kClientAddrHost1 is blocked, not expecting stun candidates for it. 1521 // Since kClientAddrHost1 is blocked, not expecting stun candidates for it.
1526 EXPECT_TRUE_WAIT(observer_.oncandidatesready_, kIceCandidatesTimeout); 1522 EXPECT_TRUE_SIMULATED_WAIT(observer_.oncandidatesready_, sfc.clock(), 9500);
1527 EXPECT_EQ(6u, observer_.mline_0_candidates_.size()); 1523 EXPECT_EQ(6u, observer_.mline_0_candidates_.size());
1528 EXPECT_EQ(6u, observer_.mline_1_candidates_.size()); 1524 EXPECT_EQ(6u, observer_.mline_1_candidates_.size());
1529 } 1525 }
1530 1526
1531 TEST_F(WebRtcSessionTest, SetSdpFailedOnInvalidSdp) { 1527 TEST_F(WebRtcSessionTest, SetSdpFailedOnInvalidSdp) {
1532 Init(); 1528 Init();
1533 SessionDescriptionInterface* offer = NULL; 1529 SessionDescriptionInterface* offer = NULL;
1534 // Since |offer| is NULL, there's no way to tell if it's an offer or answer. 1530 // Since |offer| is NULL, there's no way to tell if it's an offer or answer.
1535 std::string unknown_action; 1531 std::string unknown_action;
1536 SetLocalDescriptionExpectError(unknown_action, kInvalidSdp, offer); 1532 SetLocalDescriptionExpectError(unknown_action, kInvalidSdp, offer);
(...skipping 2880 matching lines...) Expand 10 before | Expand all | Expand 10 after
4417 } 4413 }
4418 4414
4419 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 4415 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
4420 // currently fails because upon disconnection and reconnection OnIceComplete is 4416 // currently fails because upon disconnection and reconnection OnIceComplete is
4421 // called more than once without returning to IceGatheringGathering. 4417 // called more than once without returning to IceGatheringGathering.
4422 4418
4423 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, 4419 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests,
4424 WebRtcSessionTest, 4420 WebRtcSessionTest,
4425 testing::Values(ALREADY_GENERATED, 4421 testing::Values(ALREADY_GENERATED,
4426 DTLS_IDENTITY_STORE)); 4422 DTLS_IDENTITY_STORE));
OLDNEW
« no previous file with comments | « no previous file | webrtc/base/base_tests.gyp » ('j') | webrtc/base/gunit.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698