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

Side by Side 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, 5 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
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 13 matching lines...) Expand all
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28 #import <Foundation/Foundation.h> 28 #import <Foundation/Foundation.h>
29 #import <OCMock/OCMock.h> 29 #import <OCMock/OCMock.h>
30 30
31 #import "ARDAppClient+Internal.h" 31 #import "ARDAppClient+Internal.h"
32 #import "ARDJoinResponse+Internal.h" 32 #import "ARDJoinResponse+Internal.h"
33 #import "ARDMessageResponse+Internal.h" 33 #import "ARDMessageResponse+Internal.h"
34 #import "ARDSDPUtils.h"
34 #import "RTCMediaConstraints.h" 35 #import "RTCMediaConstraints.h"
35 #import "RTCPeerConnectionFactory.h" 36 #import "RTCPeerConnectionFactory.h"
37 #import "RTCSessionDescription.h"
36 38
37 #include "webrtc/base/gunit.h" 39 #include "webrtc/base/gunit.h"
38 #include "webrtc/base/ssladapter.h" 40 #include "webrtc/base/ssladapter.h"
39 41
40 // These classes mimic XCTest APIs, to make eventual conversion to XCTest 42 // These classes mimic XCTest APIs, to make eventual conversion to XCTest
41 // easier. Conversion will happen once XCTest is supported well on build bots. 43 // easier. Conversion will happen once XCTest is supported well on build bots.
42 @interface ARDTestExpectation : NSObject 44 @interface ARDTestExpectation : NSObject
43 45
44 @property(nonatomic, readonly) NSString *description; 46 @property(nonatomic, readonly) NSString *description;
45 @property(nonatomic, readonly) BOOL isFulfilled; 47 @property(nonatomic, readonly) BOOL isFulfilled;
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 [answerer connectToRoomWithId:roomId options:nil]; 299 [answerer connectToRoomWithId:roomId options:nil];
298 [self waitForExpectationsWithTimeout:20 handler:^(NSError *error) { 300 [self waitForExpectationsWithTimeout:20 handler:^(NSError *error) {
299 if (error) { 301 if (error) {
300 NSLog(@"Expectations error: %@", error); 302 NSLog(@"Expectations error: %@", error);
301 } 303 }
302 }]; 304 }];
303 } 305 }
304 306
305 @end 307 @end
306 308
309 @interface ARDSDPUtilsTest : ARDTestCase
310 - (void)testPreferVideoCodec;
311 @end
312
313 @implementation ARDSDPUtilsTest
314
315 - (void)testPreferVideoCodec {
316 NSString *sdp = @("m=video 9 RTP/SAVPF 100 116 117 96 120\n"
317 "a=rtpmap:120 H264/90000\n");
318 NSString *expectedSdp = @("m=video 9 RTP/SAVPF 120 100 116 117 96\n"
319 "a=rtpmap:120 H264/90000\n");
320 RTCSessionDescription* desc =
321 [[RTCSessionDescription alloc] initWithType:@"offer" sdp:sdp];
322 RTCSessionDescription *h264Desc =
323 [ARDSDPUtils descriptionForDescription:desc
324 preferredVideoCodec:@"H264"];
325 EXPECT_TRUE([h264Desc.description isEqualToString:expectedSdp]);
326 }
327
328 @end
329
307 class SignalingTest : public ::testing::Test { 330 class SignalingTest : public ::testing::Test {
308 protected: 331 protected:
309 static void SetUpTestCase() { 332 static void SetUpTestCase() {
310 rtc::InitializeSSL(); 333 rtc::InitializeSSL();
311 } 334 }
312 static void TearDownTestCase() { 335 static void TearDownTestCase() {
313 rtc::CleanupSSL(); 336 rtc::CleanupSSL();
314 } 337 }
315 }; 338 };
316 339
317 TEST_F(SignalingTest, SessionTest) { 340 TEST_F(SignalingTest, SessionTest) {
318 @autoreleasepool { 341 @autoreleasepool {
319 ARDAppClientTest *test = [[ARDAppClientTest alloc] init]; 342 ARDAppClientTest *test = [[ARDAppClientTest alloc] init];
320 [test testSession]; 343 [test testSession];
321 } 344 }
322 } 345 }
346
347 TEST_F(SignalingTest, SDPTest) {
348 @autoreleasepool {
349 ARDSDPUtilsTest *test = [[ARDSDPUtilsTest alloc] init];
350 [test testPreferVideoCodec];
351 }
352 }
353
354
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698