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

Unified Diff: webrtc/examples/objc/AppRTCMobile/tests/ARDAppClientTest.mm

Issue 2520933002: iOS AppRTCMobile: Fix SDP video codec reordering for multiple H264 profiles (Closed)
Patch Set: Make code cleaner and add more tests Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/ARDSDPUtils.m ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/objc/AppRTCMobile/tests/ARDAppClientTest.mm
diff --git a/webrtc/examples/objc/AppRTCMobile/tests/ARDAppClientTest.mm b/webrtc/examples/objc/AppRTCMobile/tests/ARDAppClientTest.mm
index 20a5cf481ea26ef318c838b80002696fbb5ebeca..0de3e1523343da41f0c3ab86d0198f5d26c54d57 100644
--- a/webrtc/examples/objc/AppRTCMobile/tests/ARDAppClientTest.mm
+++ b/webrtc/examples/objc/AppRTCMobile/tests/ARDAppClientTest.mm
@@ -354,21 +354,21 @@ static NSInteger kARDAppClientTestsExpectationTimeoutError = 100;
@end
@interface ARDSDPUtilsTest : ARDTestCase
-- (void)testPreferVideoCodec;
+- (void)testPreferVideoCodec:(NSString *)codec
+ sdp:(NSString *)sdp
+ expectedSdp:(NSString *)expectedSdp;
@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");
+- (void)testPreferVideoCodec:(NSString *)codec
+ sdp:(NSString *)sdp
+ expectedSdp:(NSString *)expectedSdp {
RTCSessionDescription* desc =
[[RTCSessionDescription alloc] initWithType:RTCSdpTypeOffer sdp:sdp];
RTCSessionDescription *h264Desc =
denicija-google 2016/11/22 15:05:30 Now that the test is more generic, perhaps this sh
magjed_webrtc 2016/11/22 15:14:28 Thanks, missed that.
[ARDSDPUtils descriptionForDescription:desc
- preferredVideoCodec:@"H264"];
+ preferredVideoCodec:codec];
EXPECT_TRUE([h264Desc.description rangeOfString:expectedSdp].location != NSNotFound);
}
@@ -401,10 +401,52 @@ TEST_F(SignalingTest, SessionLocalVideoCallbackTest) {
}
#endif
-TEST_F(SignalingTest, SDPTest) {
+TEST_F(SignalingTest, SdpH264Test) {
@autoreleasepool {
ARDSDPUtilsTest *test = [[ARDSDPUtilsTest alloc] init];
- [test testPreferVideoCodec];
+ NSString *sdp = @("m=video 9 RTP/SAVPF 100 116 117 96 120 97\n"
+ "a=rtpmap:120 H264/90000\n"
+ "a=rtpmap:97 H264/90000\n");
+ NSString *expectedSdp = @("m=video 9 RTP/SAVPF 120 97 100 116 117 96\n"
+ "a=rtpmap:120 H264/90000\n"
+ "a=rtpmap:97 H264/90000\n");
+ [test testPreferVideoCodec:@"H264"
+ sdp:sdp
+ expectedSdp:expectedSdp];
+ }
+}
+
+TEST_F(SignalingTest, SdpVp8Test) {
+ @autoreleasepool {
+ ARDSDPUtilsTest *test = [[ARDSDPUtilsTest alloc] init];
+ NSString *sdp = @("m=video 9 RTP/SAVPF 100 116 117 96 120 97\n"
+ "a=rtpmap:116 VP8/90000\n");
+ NSString *expectedSdp = @("m=video 9 RTP/SAVPF 116 100 117 96 120 97\n"
+ "a=rtpmap:116 VP8/90000\n");
+ [test testPreferVideoCodec:@"VP8"
+ sdp:sdp
+ expectedSdp:expectedSdp];
+ }
+}
+
+TEST_F(SignalingTest, SdpNoMLineTest) {
+ @autoreleasepool {
+ ARDSDPUtilsTest *test = [[ARDSDPUtilsTest alloc] init];
+ NSString *sdp = @("a=rtpmap:116 VP8/90000\n");
+ [test testPreferVideoCodec:@"VP8"
+ sdp:sdp
+ expectedSdp:sdp];
+ }
+}
+
+TEST_F(SignalingTest, SdpMissingCodecTest) {
+ @autoreleasepool {
+ ARDSDPUtilsTest *test = [[ARDSDPUtilsTest alloc] init];
+ NSString *sdp = @("m=video 9 RTP/SAVPF 100 116 117 96 120 97\n"
+ "a=rtpmap:116 VP8/90000\n");
+ [test testPreferVideoCodec:@"foo"
+ sdp:sdp
+ expectedSdp:sdp];
}
}
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/ARDSDPUtils.m ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698