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

Side by Side Diff: webrtc/p2p/base/transport_unittest.cc

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address more comments Created 5 years, 5 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 | « webrtc/p2p/base/transport.cc ('k') | webrtc/p2p/base/transportchannel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 cricket::TransportStats stats; 314 cricket::TransportStats stats;
315 EXPECT_TRUE(transport_->GetStats(&stats)); 315 EXPECT_TRUE(transport_->GetStats(&stats));
316 // Note that this tests the behavior of a FakeTransportChannel. 316 // Note that this tests the behavior of a FakeTransportChannel.
317 ASSERT_EQ(1U, stats.channel_stats.size()); 317 ASSERT_EQ(1U, stats.channel_stats.size());
318 EXPECT_EQ(1, stats.channel_stats[0].component); 318 EXPECT_EQ(1, stats.channel_stats[0].component);
319 transport_->ConnectChannels(); 319 transport_->ConnectChannels();
320 EXPECT_TRUE(transport_->GetStats(&stats)); 320 EXPECT_TRUE(transport_->GetStats(&stats));
321 ASSERT_EQ(1U, stats.channel_stats.size()); 321 ASSERT_EQ(1U, stats.channel_stats.size());
322 EXPECT_EQ(1, stats.channel_stats[0].component); 322 EXPECT_EQ(1, stats.channel_stats[0].component);
323 } 323 }
324
325 TEST_F(TransportTest, TestReceivingStateChange) {
326 ASSERT_TRUE(SetupChannel());
327 channel_->SetConnectionCount(1);
328 transport_->ConnectChannels();
329 EXPECT_FALSE(transport_->any_channel_receiving());
330
331 channel_->SetReceiving(true);
332 EXPECT_TRUE_WAIT(transport_->any_channel_receiving(), 100);
333 FakeTransportChannel* channel2 = CreateChannel(2);
334 channel2->SetReceiving(true);
335 EXPECT_TRUE_WAIT(transport_->any_channel_receiving(), 100);
336
337 channel2->SetReceiving(false);
338 EXPECT_TRUE_WAIT(transport_->any_channel_receiving(), 100);
339
340 // After both channels become not receiving, the transport receiving state
341 // becomes TRANSPORT_STATE_NONE.
342 channel_->SetReceiving(false);
343 EXPECT_TRUE_WAIT(!transport_->any_channel_receiving(), 100);
344 }
OLDNEW
« no previous file with comments | « webrtc/p2p/base/transport.cc ('k') | webrtc/p2p/base/transportchannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698