OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * Copyright 2012 Google Inc. | |
4 * | 3 * |
5 * Redistribution and use in source and binary forms, with or without | 4 * Use of this source code is governed by a BSD-style license |
6 * modification, are permitted provided that the following conditions are met: | 5 * that can be found in the LICENSE file in the root of the source |
7 * | 6 * tree. An additional intellectual property rights grant can be found |
8 * 1. Redistributions of source code must retain the above copyright notice, | 7 * in the file PATENTS. All contributing project authors may |
9 * this list of conditions and the following disclaimer. | 8 * be found in the AUTHORS file in the root of the source tree. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | |
11 * this list of conditions and the following disclaimer in the documentation | |
12 * and/or other materials provided with the distribution. | |
13 * 3. The name of the author may not be used to endorse or promote products | |
14 * derived from this software without specific prior written permission. | |
15 * | |
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | |
17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | |
19 * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
20 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
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 | |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
26 */ | 9 */ |
27 | 10 |
28 #include <string> | 11 #include <string> |
29 | 12 |
30 #include "talk/app/webrtc/jsepicecandidate.h" | 13 #include "webrtc/api/jsepicecandidate.h" |
31 #include "talk/app/webrtc/jsepsessiondescription.h" | 14 #include "webrtc/api/jsepsessiondescription.h" |
32 #include "webrtc/p2p/base/candidate.h" | |
33 #include "webrtc/p2p/base/constants.h" | |
34 #include "webrtc/p2p/base/sessiondescription.h" | |
35 #include "talk/session/media/mediasession.h" | 15 #include "talk/session/media/mediasession.h" |
36 #include "webrtc/base/gunit.h" | 16 #include "webrtc/base/gunit.h" |
37 #include "webrtc/base/helpers.h" | 17 #include "webrtc/base/helpers.h" |
38 #include "webrtc/base/scoped_ptr.h" | 18 #include "webrtc/base/scoped_ptr.h" |
39 #include "webrtc/base/ssladapter.h" | 19 #include "webrtc/base/ssladapter.h" |
40 #include "webrtc/base/stringencode.h" | 20 #include "webrtc/base/stringencode.h" |
| 21 #include "webrtc/p2p/base/candidate.h" |
| 22 #include "webrtc/p2p/base/constants.h" |
| 23 #include "webrtc/p2p/base/sessiondescription.h" |
41 | 24 |
42 using webrtc::IceCandidateCollection; | 25 using webrtc::IceCandidateCollection; |
43 using webrtc::IceCandidateInterface; | 26 using webrtc::IceCandidateInterface; |
44 using webrtc::JsepIceCandidate; | 27 using webrtc::JsepIceCandidate; |
45 using webrtc::JsepSessionDescription; | 28 using webrtc::JsepSessionDescription; |
46 using webrtc::SessionDescriptionInterface; | 29 using webrtc::SessionDescriptionInterface; |
47 using rtc::scoped_ptr; | 30 using rtc::scoped_ptr; |
48 | 31 |
49 static const char kCandidateUfrag[] = "ufrag"; | 32 static const char kCandidateUfrag[] = "ufrag"; |
50 static const char kCandidatePwd[] = "pwd"; | 33 static const char kCandidatePwd[] = "pwd"; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate)); | 219 EXPECT_TRUE(jsep_desc_->AddCandidate(&jsep_candidate)); |
237 std::string sdp_with_candidate = Serialize(jsep_desc_.get()); | 220 std::string sdp_with_candidate = Serialize(jsep_desc_.get()); |
238 EXPECT_NE(sdp, sdp_with_candidate); | 221 EXPECT_NE(sdp, sdp_with_candidate); |
239 | 222 |
240 scoped_ptr<SessionDescriptionInterface> parsed_jsep_desc( | 223 scoped_ptr<SessionDescriptionInterface> parsed_jsep_desc( |
241 DeSerialize(sdp_with_candidate)); | 224 DeSerialize(sdp_with_candidate)); |
242 std::string parsed_sdp_with_candidate = Serialize(parsed_jsep_desc.get()); | 225 std::string parsed_sdp_with_candidate = Serialize(parsed_jsep_desc.get()); |
243 | 226 |
244 EXPECT_EQ(sdp_with_candidate, parsed_sdp_with_candidate); | 227 EXPECT_EQ(sdp_with_candidate, parsed_sdp_with_candidate); |
245 } | 228 } |
OLD | NEW |