| 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 12 matching lines...) Expand all Loading... |
| 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 */ | 26 */ |
| 27 | 27 |
| 28 #include <set> | 28 #include <set> |
| 29 #include <string> | 29 #include <string> |
| 30 #include <vector> | 30 #include <vector> |
| 31 | 31 |
| 32 #include "talk/app/webrtc/jsepsessiondescription.h" | 32 #include "talk/app/webrtc/jsepsessiondescription.h" |
| 33 #ifdef WEBRTC_ANDROID |
| 34 #include "talk/app/webrtc/test/androidtestinitializer.h" |
| 35 #endif |
| 33 #include "talk/app/webrtc/webrtcsdp.h" | 36 #include "talk/app/webrtc/webrtcsdp.h" |
| 34 #include "talk/media/base/constants.h" | 37 #include "talk/media/base/constants.h" |
| 35 #include "webrtc/p2p/base/constants.h" | 38 #include "webrtc/p2p/base/constants.h" |
| 36 #include "talk/session/media/mediasession.h" | 39 #include "talk/session/media/mediasession.h" |
| 37 #include "webrtc/base/gunit.h" | 40 #include "webrtc/base/gunit.h" |
| 38 #include "webrtc/base/logging.h" | 41 #include "webrtc/base/logging.h" |
| 39 #include "webrtc/base/messagedigest.h" | 42 #include "webrtc/base/messagedigest.h" |
| 40 #include "webrtc/base/scoped_ptr.h" | 43 #include "webrtc/base/scoped_ptr.h" |
| 41 #include "webrtc/base/sslfingerprint.h" | 44 #include "webrtc/base/sslfingerprint.h" |
| 42 #include "webrtc/base/stringencode.h" | 45 #include "webrtc/base/stringencode.h" |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 Replace("m=video 3457", "m=video 0", message); | 534 Replace("m=video 3457", "m=video 0", message); |
| 532 } | 535 } |
| 533 } | 536 } |
| 534 | 537 |
| 535 // WebRtcSdpTest | 538 // WebRtcSdpTest |
| 536 | 539 |
| 537 class WebRtcSdpTest : public testing::Test { | 540 class WebRtcSdpTest : public testing::Test { |
| 538 public: | 541 public: |
| 539 WebRtcSdpTest() | 542 WebRtcSdpTest() |
| 540 : jdesc_(kDummyString) { | 543 : jdesc_(kDummyString) { |
| 544 #ifdef WEBRTC_ANDROID |
| 545 webrtc::InitializeAndroidObjects(); |
| 546 #endif |
| 541 // AudioContentDescription | 547 // AudioContentDescription |
| 542 audio_desc_ = CreateAudioContentDescription(); | 548 audio_desc_ = CreateAudioContentDescription(); |
| 543 AudioCodec opus(111, "opus", 48000, 0, 2, 3); | 549 AudioCodec opus(111, "opus", 48000, 0, 2, 3); |
| 544 audio_desc_->AddCodec(opus); | 550 audio_desc_->AddCodec(opus); |
| 545 audio_desc_->AddCodec(AudioCodec(103, "ISAC", 16000, 32000, 1, 2)); | 551 audio_desc_->AddCodec(AudioCodec(103, "ISAC", 16000, 32000, 1, 2)); |
| 546 audio_desc_->AddCodec(AudioCodec(104, "ISAC", 32000, 56000, 1, 1)); | 552 audio_desc_->AddCodec(AudioCodec(104, "ISAC", 32000, 56000, 1, 1)); |
| 547 desc_.AddContent(kAudioContentName, NS_JINGLE_RTP, audio_desc_); | 553 desc_.AddContent(kAudioContentName, NS_JINGLE_RTP, audio_desc_); |
| 548 | 554 |
| 549 // VideoContentDescription | 555 // VideoContentDescription |
| 550 rtc::scoped_ptr<VideoContentDescription> video( | 556 rtc::scoped_ptr<VideoContentDescription> video( |
| (...skipping 2156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2707 const cricket::MediaContentDescription* mdesc = | 2713 const cricket::MediaContentDescription* mdesc = |
| 2708 static_cast<const cricket::MediaContentDescription*>( | 2714 static_cast<const cricket::MediaContentDescription*>( |
| 2709 desc->contents()[i].description); | 2715 desc->contents()[i].description); |
| 2710 EXPECT_EQ(media_types[media_content_in_sdp[i]], mdesc->type()); | 2716 EXPECT_EQ(media_types[media_content_in_sdp[i]], mdesc->type()); |
| 2711 } | 2717 } |
| 2712 | 2718 |
| 2713 std::string serialized_sdp = webrtc::SdpSerialize(jdesc); | 2719 std::string serialized_sdp = webrtc::SdpSerialize(jdesc); |
| 2714 EXPECT_EQ(sdp_string, serialized_sdp); | 2720 EXPECT_EQ(sdp_string, serialized_sdp); |
| 2715 } | 2721 } |
| 2716 } | 2722 } |
| OLD | NEW |