OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 *transport2.description.identity_fingerprint); | 876 *transport2.description.identity_fingerprint); |
877 } else { | 877 } else { |
878 EXPECT_EQ(transport1.description.identity_fingerprint.get(), | 878 EXPECT_EQ(transport1.description.identity_fingerprint.get(), |
879 transport2.description.identity_fingerprint.get()); | 879 transport2.description.identity_fingerprint.get()); |
880 } | 880 } |
881 EXPECT_EQ(transport1.description.transport_options, | 881 EXPECT_EQ(transport1.description.transport_options, |
882 transport2.description.transport_options); | 882 transport2.description.transport_options); |
883 EXPECT_TRUE(CompareCandidates(transport1.description.candidates, | 883 EXPECT_TRUE(CompareCandidates(transport1.description.candidates, |
884 transport2.description.candidates)); | 884 transport2.description.candidates)); |
885 } | 885 } |
| 886 |
| 887 // global attributes |
| 888 EXPECT_EQ(desc1.msid_supported(), desc2.msid_supported()); |
886 } | 889 } |
887 | 890 |
888 bool CompareCandidates(const Candidates& cs1, const Candidates& cs2) { | 891 bool CompareCandidates(const Candidates& cs1, const Candidates& cs2) { |
889 EXPECT_EQ(cs1.size(), cs2.size()); | 892 EXPECT_EQ(cs1.size(), cs2.size()); |
890 if (cs1.size() != cs2.size()) | 893 if (cs1.size() != cs2.size()) |
891 return false; | 894 return false; |
892 for (size_t i = 0; i< cs1.size(); ++i) { | 895 for (size_t i = 0; i< cs1.size(); ++i) { |
893 const Candidate c1 = cs1.at(i); | 896 const Candidate c1 = cs1.at(i); |
894 const Candidate c2 = cs2.at(i); | 897 const Candidate c2 = cs2.at(i); |
895 EXPECT_TRUE(c1.IsEquivalent(c2)); | 898 EXPECT_TRUE(c1.IsEquivalent(c2)); |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1960 EXPECT_TRUE(TestDeserializeRejected(false, true)); | 1963 EXPECT_TRUE(TestDeserializeRejected(false, true)); |
1961 } | 1964 } |
1962 | 1965 |
1963 TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithRejectedAudioVideo) { | 1966 TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithRejectedAudioVideo) { |
1964 EXPECT_TRUE(TestDeserializeRejected(true, true)); | 1967 EXPECT_TRUE(TestDeserializeRejected(true, true)); |
1965 } | 1968 } |
1966 | 1969 |
1967 // Tests that we can still handle the sdp uses mslabel and label instead of | 1970 // Tests that we can still handle the sdp uses mslabel and label instead of |
1968 // msid for backward compatibility. | 1971 // msid for backward compatibility. |
1969 TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithoutMsid) { | 1972 TEST_F(WebRtcSdpTest, DeserializeSessionDescriptionWithoutMsid) { |
| 1973 jdesc_.description()->set_msid_supported(false); |
1970 JsepSessionDescription jdesc(kDummyString); | 1974 JsepSessionDescription jdesc(kDummyString); |
1971 std::string sdp_without_msid = kSdpFullString; | 1975 std::string sdp_without_msid = kSdpFullString; |
1972 Replace("msid", "xmsid", &sdp_without_msid); | 1976 Replace("msid", "xmsid", &sdp_without_msid); |
1973 // Deserialize | 1977 // Deserialize |
1974 EXPECT_TRUE(SdpDeserialize(sdp_without_msid, &jdesc)); | 1978 EXPECT_TRUE(SdpDeserialize(sdp_without_msid, &jdesc)); |
1975 // Verify | 1979 // Verify |
1976 EXPECT_TRUE(CompareSessionDescription(jdesc_, jdesc)); | 1980 EXPECT_TRUE(CompareSessionDescription(jdesc_, jdesc)); |
1977 } | 1981 } |
1978 | 1982 |
1979 TEST_F(WebRtcSdpTest, DeserializeCandidate) { | 1983 TEST_F(WebRtcSdpTest, DeserializeCandidate) { |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2697 const cricket::MediaContentDescription* mdesc = | 2701 const cricket::MediaContentDescription* mdesc = |
2698 static_cast<const cricket::MediaContentDescription*>( | 2702 static_cast<const cricket::MediaContentDescription*>( |
2699 desc->contents()[i].description); | 2703 desc->contents()[i].description); |
2700 EXPECT_EQ(media_types[media_content_in_sdp[i]], mdesc->type()); | 2704 EXPECT_EQ(media_types[media_content_in_sdp[i]], mdesc->type()); |
2701 } | 2705 } |
2702 | 2706 |
2703 std::string serialized_sdp = webrtc::SdpSerialize(jdesc); | 2707 std::string serialized_sdp = webrtc::SdpSerialize(jdesc); |
2704 EXPECT_EQ(sdp_string, serialized_sdp); | 2708 EXPECT_EQ(sdp_string, serialized_sdp); |
2705 } | 2709 } |
2706 } | 2710 } |
OLD | NEW |