OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2009 Google Inc. | 3 * Copyright 2009 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 ASSERT_TRUE(GetTransport2()); | 1467 ASSERT_TRUE(GetTransport2()); |
1468 EXPECT_EQ(2U, GetTransport1()->channels().size()); | 1468 EXPECT_EQ(2U, GetTransport1()->channels().size()); |
1469 EXPECT_EQ(expected_channels, GetTransport2()->channels().size()); | 1469 EXPECT_EQ(expected_channels, GetTransport2()->channels().size()); |
1470 EXPECT_TRUE(SendAccept()); | 1470 EXPECT_TRUE(SendAccept()); |
1471 EXPECT_EQ(expected_channels, GetTransport1()->channels().size()); | 1471 EXPECT_EQ(expected_channels, GetTransport1()->channels().size()); |
1472 EXPECT_EQ(expected_channels, GetTransport2()->channels().size()); | 1472 EXPECT_EQ(expected_channels, GetTransport2()->channels().size()); |
1473 EXPECT_TRUE(channel1_->bundle_filter()->FindPayloadType(pl_type1)); | 1473 EXPECT_TRUE(channel1_->bundle_filter()->FindPayloadType(pl_type1)); |
1474 EXPECT_TRUE(channel2_->bundle_filter()->FindPayloadType(pl_type1)); | 1474 EXPECT_TRUE(channel2_->bundle_filter()->FindPayloadType(pl_type1)); |
1475 EXPECT_FALSE(channel1_->bundle_filter()->FindPayloadType(pl_type2)); | 1475 EXPECT_FALSE(channel1_->bundle_filter()->FindPayloadType(pl_type2)); |
1476 EXPECT_FALSE(channel2_->bundle_filter()->FindPayloadType(pl_type2)); | 1476 EXPECT_FALSE(channel2_->bundle_filter()->FindPayloadType(pl_type2)); |
1477 // channel1 - should only have media_content2 as remote. i.e. kSsrc2 | |
1478 EXPECT_TRUE(channel1_->bundle_filter()->FindStream(kSsrc2)); | |
1479 EXPECT_FALSE(channel1_->bundle_filter()->FindStream(kSsrc1)); | |
1480 // channel2 - should only have media_content1 as remote. i.e. kSsrc1 | |
1481 EXPECT_TRUE(channel2_->bundle_filter()->FindStream(kSsrc1)); | |
1482 EXPECT_FALSE(channel2_->bundle_filter()->FindStream(kSsrc2)); | |
1483 | 1477 |
1484 // Both channels can receive pl_type1 only. | 1478 // Both channels can receive pl_type1 only. |
1485 EXPECT_TRUE(SendCustomRtp1(kSsrc1, ++sequence_number1_1, pl_type1)); | 1479 EXPECT_TRUE(SendCustomRtp1(kSsrc1, ++sequence_number1_1, pl_type1)); |
1486 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, sequence_number1_1, pl_type1)); | 1480 EXPECT_TRUE(CheckCustomRtp2(kSsrc1, sequence_number1_1, pl_type1)); |
1487 EXPECT_TRUE(SendCustomRtp2(kSsrc2, ++sequence_number2_2, pl_type1)); | 1481 EXPECT_TRUE(SendCustomRtp2(kSsrc2, ++sequence_number2_2, pl_type1)); |
1488 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, sequence_number2_2, pl_type1)); | 1482 EXPECT_TRUE(CheckCustomRtp1(kSsrc2, sequence_number2_2, pl_type1)); |
1489 EXPECT_TRUE(CheckNoRtp1()); | 1483 EXPECT_TRUE(CheckNoRtp1()); |
1490 EXPECT_TRUE(CheckNoRtp2()); | 1484 EXPECT_TRUE(CheckNoRtp2()); |
1491 | 1485 |
1492 // RTCP test | 1486 // RTCP test |
1493 EXPECT_TRUE(SendCustomRtp1(kSsrc1, ++sequence_number1_1, pl_type2)); | 1487 EXPECT_TRUE(SendCustomRtp1(kSsrc1, ++sequence_number1_1, pl_type2)); |
1494 EXPECT_FALSE(CheckCustomRtp2(kSsrc1, sequence_number1_1, pl_type2)); | 1488 EXPECT_FALSE(CheckCustomRtp2(kSsrc1, sequence_number1_1, pl_type2)); |
1495 EXPECT_TRUE(SendCustomRtp2(kSsrc2, ++sequence_number2_2, pl_type2)); | 1489 EXPECT_TRUE(SendCustomRtp2(kSsrc2, ++sequence_number2_2, pl_type2)); |
1496 EXPECT_FALSE(CheckCustomRtp1(kSsrc2, sequence_number2_2, pl_type2)); | 1490 EXPECT_FALSE(CheckCustomRtp1(kSsrc2, sequence_number2_2, pl_type2)); |
1497 | 1491 |
1498 EXPECT_TRUE(SendCustomRtcp1(kSsrc1)); | 1492 EXPECT_TRUE(SendCustomRtcp1(kSsrc1)); |
1499 EXPECT_TRUE(SendCustomRtcp2(kSsrc2)); | 1493 EXPECT_TRUE(SendCustomRtcp2(kSsrc2)); |
1500 EXPECT_TRUE(CheckCustomRtcp1(kSsrc2)); | 1494 EXPECT_TRUE(CheckCustomRtcp1(kSsrc2)); |
1501 EXPECT_TRUE(CheckNoRtcp1()); | 1495 EXPECT_TRUE(CheckNoRtcp1()); |
1502 EXPECT_TRUE(CheckCustomRtcp2(kSsrc1)); | 1496 EXPECT_TRUE(CheckCustomRtcp2(kSsrc1)); |
1503 EXPECT_TRUE(CheckNoRtcp2()); | 1497 EXPECT_TRUE(CheckNoRtcp2()); |
1504 | 1498 |
1505 EXPECT_TRUE(SendCustomRtcp1(kSsrc2)); | 1499 EXPECT_TRUE(SendCustomRtcp1(kSsrc2)); |
1506 EXPECT_TRUE(SendCustomRtcp2(kSsrc1)); | 1500 EXPECT_TRUE(SendCustomRtcp2(kSsrc1)); |
1507 EXPECT_FALSE(CheckCustomRtcp1(kSsrc1)); | 1501 // Bundle filter shouldn't filter out any RTCP. |
1508 EXPECT_FALSE(CheckCustomRtcp2(kSsrc2)); | 1502 EXPECT_TRUE(CheckCustomRtcp1(kSsrc1)); |
| 1503 EXPECT_TRUE(CheckCustomRtcp2(kSsrc2)); |
1509 } | 1504 } |
1510 | 1505 |
1511 // Test that the media monitor can be run and gives timely callbacks. | 1506 // Test that the media monitor can be run and gives timely callbacks. |
1512 void TestMediaMonitor() { | 1507 void TestMediaMonitor() { |
1513 static const int kTimeout = 500; | 1508 static const int kTimeout = 500; |
1514 CreateChannels(0, 0); | 1509 CreateChannels(0, 0); |
1515 EXPECT_TRUE(SendInitiate()); | 1510 EXPECT_TRUE(SendInitiate()); |
1516 EXPECT_TRUE(SendAccept()); | 1511 EXPECT_TRUE(SendAccept()); |
1517 channel1_->StartMediaMonitor(100); | 1512 channel1_->StartMediaMonitor(100); |
1518 channel2_->StartMediaMonitor(100); | 1513 channel2_->StartMediaMonitor(100); |
(...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2793 }; | 2788 }; |
2794 rtc::Buffer payload(data, 3); | 2789 rtc::Buffer payload(data, 3); |
2795 cricket::SendDataResult result; | 2790 cricket::SendDataResult result; |
2796 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 2791 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
2797 EXPECT_EQ(params.ssrc, | 2792 EXPECT_EQ(params.ssrc, |
2798 media_channel1_->last_sent_data_params().ssrc); | 2793 media_channel1_->last_sent_data_params().ssrc); |
2799 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 2794 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
2800 } | 2795 } |
2801 | 2796 |
2802 // TODO(pthatcher): TestSetReceiver? | 2797 // TODO(pthatcher): TestSetReceiver? |
OLD | NEW |