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

Unified Diff: talk/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm

Issue 1187573004: iOS HW H264 support. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Move unittest file. Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
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];
+ }
+}
+
+

Powered by Google App Engine
This is Rietveld 408576698