| Index: talk/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm
|
| diff --git a/talk/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm b/talk/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm
|
| index 396f64f6cf829c5b212af04f2e4424885640b365..47df526227822391a15aa5d8004030ca4a5d4ff3 100644
|
| --- a/talk/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm
|
| +++ b/talk/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm
|
| @@ -31,8 +31,10 @@
|
| #import "ARDAppClient+Internal.h"
|
| #import "ARDJoinResponse+Internal.h"
|
| #import "ARDMessageResponse+Internal.h"
|
| +#import "ARDSDPUtils.h"
|
| #import "RTCMediaConstraints.h"
|
| #import "RTCPeerConnectionFactory.h"
|
| +#import "RTCSessionDescription.h"
|
|
|
| #include "webrtc/base/gunit.h"
|
| #include "webrtc/base/ssladapter.h"
|
| @@ -304,6 +306,27 @@
|
|
|
| @end
|
|
|
| +@interface ARDSDPUtilsTest : ARDTestCase
|
| +- (void)testPreferVideoCodec;
|
| +@end
|
| +
|
| +@implementation ARDSDPUtilsTest
|
| +
|
| +- (void)testPreferVideoCodec {
|
| + NSString *sdp = @("m=video 9 RTP/SAVPF 100 116 117 96 120\n"
|
| + "a=rtpmap:120 H264/90000\n");
|
| + NSString *expectedSdp = @("m=video 9 RTP/SAVPF 120 100 116 117 96\n"
|
| + "a=rtpmap:120 H264/90000\n");
|
| + RTCSessionDescription* desc =
|
| + [[RTCSessionDescription alloc] initWithType:@"offer" sdp:sdp];
|
| + RTCSessionDescription *h264Desc =
|
| + [ARDSDPUtils descriptionForDescription:desc
|
| + preferredVideoCodec:@"H264"];
|
| + EXPECT_TRUE([h264Desc.description isEqualToString:expectedSdp]);
|
| +}
|
| +
|
| +@end
|
| +
|
| class SignalingTest : public ::testing::Test {
|
| protected:
|
| static void SetUpTestCase() {
|
| @@ -320,3 +343,12 @@ TEST_F(SignalingTest, SessionTest) {
|
| [test testSession];
|
| }
|
| }
|
| +
|
| +TEST_F(SignalingTest, SDPTest) {
|
| + @autoreleasepool {
|
| + ARDSDPUtilsTest *test = [[ARDSDPUtilsTest alloc] init];
|
| + [test testPreferVideoCodec];
|
| + }
|
| +}
|
| +
|
| +
|
|
|