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

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

Issue 1690313002: Update iOS AppRTCDemo to use the updated Objective-C API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update against master (statsId -> reportId) Created 4 years, 9 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: webrtc/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm
diff --git a/webrtc/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm b/webrtc/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm
index 2470e50c9ebd1bcaf4d30d3c60a5a49c6f11168c..946b253e8ce0b7f82526ab8051be23dd2ea1dd32 100644
--- a/webrtc/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm
+++ b/webrtc/examples/objc/AppRTCDemo/tests/ARDAppClientTest.mm
@@ -8,19 +8,19 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "webrtc/base/gunit.h"
+#include "webrtc/base/ssladapter.h"
+
#import <Foundation/Foundation.h>
tkchin_webrtc 2016/03/11 20:47:38 system libraries first (foundation, ocmock) then
hjon_webrtc 2016/03/11 22:44:15 I also seem to recall #includes before #imports, c
tkchin_webrtc 2016/03/11 23:33:23 yeah. This looks good.
#import <OCMock/OCMock.h>
+#import "webrtc/api/objc/RTCMediaConstraints.h"
+#import "webrtc/api/objc/RTCPeerConnectionFactory.h"
+#import "webrtc/api/objc/RTCSessionDescription.h"
#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"
// These classes mimic XCTest APIs, to make eventual conversion to XCTest
// easier. Conversion will happen once XCTest is supported well on build bots.
@@ -217,7 +217,8 @@
[OCMockObject niceMockForProtocol:@protocol(ARDAppClientDelegate)];
[[[delegate stub] andDo:^(NSInvocation *invocation) {
connectedHandler();
- }] appClient:[OCMArg any] didChangeConnectionState:RTCICEConnectionConnected];
+ }] appClient:[OCMArg any]
+ didChangeConnectionState:RTCIceConnectionStateConnected];
return [[ARDAppClient alloc] initWithRoomServerClient:roomServerClient
signalingChannel:signalingChannel
@@ -228,8 +229,8 @@
// Tests that an ICE connection is established between two ARDAppClient objects
// where one is set up as a caller and the other the answerer. Network
// components are mocked out and messages are relayed directly from object to
-// object. It's expected that both clients reach the RTCICEConnectionConnected
-// state within a reasonable amount of time.
+// object. It's expected that both clients reach the
+// RTCIceConnectionStateConnected state within a reasonable amount of time.
- (void)testSession {
// Need block arguments here because we're setting up a callbacks before we
// create the clients.
@@ -258,7 +259,9 @@
}];
// TODO(tkchin): Figure out why DTLS-SRTP constraint causes thread assertion
// crash in Debug.
- caller.defaultPeerConnectionConstraints = [[RTCMediaConstraints alloc] init];
+ caller.defaultPeerConnectionConstraints =
+ [[RTCMediaConstraints alloc] initWithMandatoryConstraints:nil
+ optionalConstraints:nil];
weakCaller = caller;
answerer = [self createAppClientForRoomId:roomId
@@ -274,7 +277,8 @@
// TODO(tkchin): Figure out why DTLS-SRTP constraint causes thread assertion
// crash in Debug.
answerer.defaultPeerConnectionConstraints =
- [[RTCMediaConstraints alloc] init];
+ [[RTCMediaConstraints alloc] initWithMandatoryConstraints:nil
+ optionalConstraints:nil];
weakAnswerer = answerer;
// Kick off connection.
@@ -301,7 +305,7 @@
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 alloc] initWithType:RTCSdpTypeOffer sdp:sdp];
RTCSessionDescription *h264Desc =
[ARDSDPUtils descriptionForDescription:desc
preferredVideoCodec:@"H264"];

Powered by Google App Engine
This is Rietveld 408576698