Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: webrtc/api/objctests/RTCSessionDescriptionTest.mm

Issue 1696673003: Tweaks for new Objective-C API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Don't use object subscripting Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/api/objctests/RTCIceServerTest.mm ('k') | webrtc/base/objc/RTCSSLAdapter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2015 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 18 matching lines...) Expand all
29 */ 29 */
30 - (void)testSessionDescriptionConversion { 30 - (void)testSessionDescriptionConversion {
31 RTCSessionDescription *description = 31 RTCSessionDescription *description =
32 [[RTCSessionDescription alloc] initWithType:RTCSdpTypeAnswer 32 [[RTCSessionDescription alloc] initWithType:RTCSdpTypeAnswer
33 sdp:[self sdp]]; 33 sdp:[self sdp]];
34 34
35 webrtc::SessionDescriptionInterface *nativeDescription = 35 webrtc::SessionDescriptionInterface *nativeDescription =
36 description.nativeDescription; 36 description.nativeDescription;
37 37
38 EXPECT_EQ(RTCSdpTypeAnswer, 38 EXPECT_EQ(RTCSdpTypeAnswer,
39 [RTCSessionDescription typeForString:nativeDescription->type()]); 39 [RTCSessionDescription typeForStdString:nativeDescription->type()]);
40 40
41 std::string sdp; 41 std::string sdp;
42 nativeDescription->ToString(&sdp); 42 nativeDescription->ToString(&sdp);
43 EXPECT_EQ([self sdp].stdString, sdp); 43 EXPECT_EQ([self sdp].stdString, sdp);
44 } 44 }
45 45
46 - (void)testInitFromNativeSessionDescription { 46 - (void)testInitFromNativeSessionDescription {
47 webrtc::SessionDescriptionInterface *nativeDescription; 47 webrtc::SessionDescriptionInterface *nativeDescription;
48 48
49 nativeDescription = webrtc::CreateSessionDescription( 49 nativeDescription = webrtc::CreateSessionDescription(
50 webrtc::SessionDescriptionInterface::kAnswer, 50 webrtc::SessionDescriptionInterface::kAnswer,
51 [self sdp].stdString, 51 [self sdp].stdString,
52 nullptr); 52 nullptr);
53 53
54 RTCSessionDescription *description = 54 RTCSessionDescription *description =
55 [[RTCSessionDescription alloc] initWithNativeDescription: 55 [[RTCSessionDescription alloc] initWithNativeDescription:
56 nativeDescription]; 56 nativeDescription];
57 EXPECT_EQ(webrtc::SessionDescriptionInterface::kAnswer, 57 EXPECT_EQ(webrtc::SessionDescriptionInterface::kAnswer,
58 [RTCSessionDescription stringForType:description.type]); 58 [RTCSessionDescription stdStringForType:description.type]);
59 EXPECT_TRUE([[self sdp] isEqualToString:description.sdp]); 59 EXPECT_TRUE([[self sdp] isEqualToString:description.sdp]);
60 } 60 }
61 61
62 - (NSString *)sdp { 62 - (NSString *)sdp {
63 return @"v=0\r\n" 63 return @"v=0\r\n"
64 "o=- 5319989746393411314 2 IN IP4 127.0.0.1\r\n" 64 "o=- 5319989746393411314 2 IN IP4 127.0.0.1\r\n"
65 "s=-\r\n" 65 "s=-\r\n"
66 "t=0 0\r\n" 66 "t=0 0\r\n"
67 "a=group:BUNDLE audio video\r\n" 67 "a=group:BUNDLE audio video\r\n"
68 "a=msid-semantic: WMS ARDAMS\r\n" 68 "a=msid-semantic: WMS ARDAMS\r\n"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 [test testSessionDescriptionConversion]; 135 [test testSessionDescriptionConversion];
136 } 136 }
137 } 137 }
138 138
139 TEST(RTCSessionDescriptionTest, InitFromSessionDescriptionTest) { 139 TEST(RTCSessionDescriptionTest, InitFromSessionDescriptionTest) {
140 @autoreleasepool { 140 @autoreleasepool {
141 RTCSessionDescriptionTest *test = [[RTCSessionDescriptionTest alloc] init]; 141 RTCSessionDescriptionTest *test = [[RTCSessionDescriptionTest alloc] init];
142 [test testInitFromNativeSessionDescription]; 142 [test testInitFromNativeSessionDescription];
143 } 143 }
144 } 144 }
OLDNEW
« no previous file with comments | « webrtc/api/objctests/RTCIceServerTest.mm ('k') | webrtc/base/objc/RTCSSLAdapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698