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

Side by Side Diff: talk/app/webrtc/objctests/RTCPeerConnectionSyncObserver.m

Issue 1350523003: TransportController refactoring. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing Mac test. Created 5 years, 3 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
« no previous file with comments | « no previous file | talk/app/webrtc/objctests/RTCPeerConnectionTest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 190
191 - (void)peerConnection:(RTCPeerConnection*)peerConnection 191 - (void)peerConnection:(RTCPeerConnection*)peerConnection
192 iceGatheringChanged:(RTCICEGatheringState)newState { 192 iceGatheringChanged:(RTCICEGatheringState)newState {
193 // It's fine to get a variable number of GATHERING messages before 193 // It's fine to get a variable number of GATHERING messages before
194 // COMPLETE fires (depending on how long the test runs) so we don't assert 194 // COMPLETE fires (depending on how long the test runs) so we don't assert
195 // any particular count. 195 // any particular count.
196 if (newState == RTCICEGatheringGathering) { 196 if (newState == RTCICEGatheringGathering) {
197 return; 197 return;
198 } 198 }
199 NSAssert([_expectedICEGatheringChanges count] > 0,
200 @"Unexpected ICE gathering state change");
199 int expectedState = [self popFirstElementAsInt:_expectedICEGatheringChanges]; 201 int expectedState = [self popFirstElementAsInt:_expectedICEGatheringChanges];
200 NSAssert(expectedState == (int)newState, @"Empty expectation array"); 202 NSAssert(expectedState == (int)newState,
203 @"ICE gathering state should match expectation");
201 } 204 }
202 205
203 - (void)peerConnection:(RTCPeerConnection*)peerConnection 206 - (void)peerConnection:(RTCPeerConnection*)peerConnection
204 iceConnectionChanged:(RTCICEConnectionState)newState { 207 iceConnectionChanged:(RTCICEConnectionState)newState {
205 // See TODO(fischman) in RTCPeerConnectionTest.mm about Completed. 208 // See TODO(fischman) in RTCPeerConnectionTest.mm about Completed.
206 if (newState == RTCICEConnectionCompleted) 209 if (newState == RTCICEConnectionCompleted)
207 return; 210 return;
211 NSAssert([_expectedICEConnectionChanges count] > 0,
212 @"Unexpected ICE connection state change");
208 int expectedState = [self popFirstElementAsInt:_expectedICEConnectionChanges]; 213 int expectedState = [self popFirstElementAsInt:_expectedICEConnectionChanges];
209 NSAssert(expectedState == (int)newState, @"Empty expectation array"); 214 NSAssert(expectedState == (int)newState,
215 @"ICE connection state should match expectation");
210 } 216 }
211 217
212 - (void)peerConnection:(RTCPeerConnection*)peerConnection 218 - (void)peerConnection:(RTCPeerConnection*)peerConnection
213 didOpenDataChannel:(RTCDataChannel*)dataChannel { 219 didOpenDataChannel:(RTCDataChannel*)dataChannel {
214 NSString* expectedLabel = 220 NSString* expectedLabel =
215 [self popFirstElementAsNSString:_expectedDataChannels]; 221 [self popFirstElementAsNSString:_expectedDataChannels];
216 NSAssert([expectedLabel isEqual:dataChannel.label], 222 NSAssert([expectedLabel isEqual:dataChannel.label],
217 @"Data channel not expected"); 223 @"Data channel not expected");
218 self.dataChannel = dataChannel; 224 self.dataChannel = dataChannel;
219 dataChannel.delegate = self; 225 dataChannel.delegate = self;
(...skipping 22 matching lines...) Expand all
242 @"Unexpected message received"); 248 @"Unexpected message received");
243 RTCDataBuffer* expectedBuffer = [_expectedMessages objectAtIndex:0]; 249 RTCDataBuffer* expectedBuffer = [_expectedMessages objectAtIndex:0];
244 NSAssert(expectedBuffer.isBinary == buffer.isBinary, 250 NSAssert(expectedBuffer.isBinary == buffer.isBinary,
245 @"Buffer isBinary should match"); 251 @"Buffer isBinary should match");
246 NSAssert([expectedBuffer.data isEqual:buffer.data], 252 NSAssert([expectedBuffer.data isEqual:buffer.data],
247 @"Buffer data should match"); 253 @"Buffer data should match");
248 [_expectedMessages removeObjectAtIndex:0]; 254 [_expectedMessages removeObjectAtIndex:0];
249 } 255 }
250 256
251 @end 257 @end
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/objctests/RTCPeerConnectionTest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698