OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2014 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 |
11 #import <Foundation/Foundation.h> | 11 #import <Foundation/Foundation.h> |
12 #import <OCMock/OCMock.h> | 12 #import <OCMock/OCMock.h> |
13 | 13 |
14 #import "ARDAppClient+Internal.h" | 14 #import "ARDAppClient+Internal.h" |
15 #import "ARDJoinResponse+Internal.h" | 15 #import "ARDJoinResponse+Internal.h" |
16 #import "ARDMessageResponse+Internal.h" | 16 #import "ARDMessageResponse+Internal.h" |
17 #import "ARDSDPUtils.h" | 17 #import "ARDSDPUtils.h" |
18 #import "RTCMediaConstraints.h" | 18 #import "webrtc/api/objc/RTCMediaConstraints.h" |
19 #import "RTCPeerConnectionFactory.h" | 19 #import "webrtc/api/objc/RTCPeerConnectionFactory.h" |
20 #import "RTCSessionDescription.h" | 20 #import "webrtc/api/objc/RTCSessionDescription.h" |
21 | 21 |
22 #include "webrtc/base/gunit.h" | 22 #include "webrtc/base/gunit.h" |
23 #include "webrtc/base/ssladapter.h" | 23 #include "webrtc/base/ssladapter.h" |
24 | 24 |
25 // These classes mimic XCTest APIs, to make eventual conversion to XCTest | 25 // These classes mimic XCTest APIs, to make eventual conversion to XCTest |
26 // easier. Conversion will happen once XCTest is supported well on build bots. | 26 // easier. Conversion will happen once XCTest is supported well on build bots. |
27 @interface ARDTestExpectation : NSObject | 27 @interface ARDTestExpectation : NSObject |
28 | 28 |
29 @property(nonatomic, readonly) NSString *description; | 29 @property(nonatomic, readonly) NSString *description; |
30 @property(nonatomic, readonly) BOOL isFulfilled; | 30 @property(nonatomic, readonly) BOOL isFulfilled; |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 @end | 294 @end |
295 | 295 |
296 @implementation ARDSDPUtilsTest | 296 @implementation ARDSDPUtilsTest |
297 | 297 |
298 - (void)testPreferVideoCodec { | 298 - (void)testPreferVideoCodec { |
299 NSString *sdp = @("m=video 9 RTP/SAVPF 100 116 117 96 120\n" | 299 NSString *sdp = @("m=video 9 RTP/SAVPF 100 116 117 96 120\n" |
300 "a=rtpmap:120 H264/90000\n"); | 300 "a=rtpmap:120 H264/90000\n"); |
301 NSString *expectedSdp = @("m=video 9 RTP/SAVPF 120 100 116 117 96\n" | 301 NSString *expectedSdp = @("m=video 9 RTP/SAVPF 120 100 116 117 96\n" |
302 "a=rtpmap:120 H264/90000\n"); | 302 "a=rtpmap:120 H264/90000\n"); |
303 RTCSessionDescription* desc = | 303 RTCSessionDescription* desc = |
304 [[RTCSessionDescription alloc] initWithType:@"offer" sdp:sdp]; | 304 [[RTCSessionDescription alloc] initWithType:RTCSdpTypeOffer sdp:sdp]; |
305 RTCSessionDescription *h264Desc = | 305 RTCSessionDescription *h264Desc = |
306 [ARDSDPUtils descriptionForDescription:desc | 306 [ARDSDPUtils descriptionForDescription:desc |
307 preferredVideoCodec:@"H264"]; | 307 preferredVideoCodec:@"H264"]; |
308 EXPECT_TRUE([h264Desc.description isEqualToString:expectedSdp]); | 308 EXPECT_TRUE([h264Desc.description isEqualToString:expectedSdp]); |
309 } | 309 } |
310 | 310 |
311 @end | 311 @end |
312 | 312 |
313 class SignalingTest : public ::testing::Test { | 313 class SignalingTest : public ::testing::Test { |
314 protected: | 314 protected: |
(...skipping 13 matching lines...) Expand all Loading... |
328 } | 328 } |
329 | 329 |
330 TEST_F(SignalingTest, SDPTest) { | 330 TEST_F(SignalingTest, SDPTest) { |
331 @autoreleasepool { | 331 @autoreleasepool { |
332 ARDSDPUtilsTest *test = [[ARDSDPUtilsTest alloc] init]; | 332 ARDSDPUtilsTest *test = [[ARDSDPUtilsTest alloc] init]; |
333 [test testPreferVideoCodec]; | 333 [test testPreferVideoCodec]; |
334 } | 334 } |
335 } | 335 } |
336 | 336 |
337 | 337 |
OLD | NEW |