OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |