OLD | NEW |
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 NSString* expectedLabel = | 226 NSString* expectedLabel = |
227 [self popFirstElementAsNSString:_expectedDataChannels]; | 227 [self popFirstElementAsNSString:_expectedDataChannels]; |
228 NSAssert([expectedLabel isEqual:dataChannel.label], | 228 NSAssert([expectedLabel isEqual:dataChannel.label], |
229 @"Data channel not expected"); | 229 @"Data channel not expected"); |
230 self.dataChannel = dataChannel; | 230 self.dataChannel = dataChannel; |
231 dataChannel.delegate = self; | 231 dataChannel.delegate = self; |
232 NSAssert(kRTCDataChannelStateConnecting == dataChannel.state, | 232 NSAssert(kRTCDataChannelStateConnecting == dataChannel.state, |
233 @"Unexpected state"); | 233 @"Unexpected state"); |
234 } | 234 } |
235 | 235 |
236 - (void)peerConnectionOnFirstMediaPacketReceived: | |
237 (RTCPeerConnection*)peerConnection { | |
238 } | |
239 | |
240 #pragma mark - RTCDataChannelDelegate | 236 #pragma mark - RTCDataChannelDelegate |
241 | 237 |
242 - (void)channelDidChangeState:(RTCDataChannel*)channel { | 238 - (void)channelDidChangeState:(RTCDataChannel*)channel { |
243 NSAssert([_expectedStateChanges count] > 0, | 239 NSAssert([_expectedStateChanges count] > 0, |
244 @"Unexpected state change"); | 240 @"Unexpected state change"); |
245 int expectedState = [self popFirstElementAsInt:_expectedStateChanges]; | 241 int expectedState = [self popFirstElementAsInt:_expectedStateChanges]; |
246 NSAssert(expectedState == channel.state, @"Channel state should match"); | 242 NSAssert(expectedState == channel.state, @"Channel state should match"); |
247 } | 243 } |
248 | 244 |
249 - (void)channel:(RTCDataChannel*)channel | 245 - (void)channel:(RTCDataChannel*)channel |
250 didChangeBufferedAmount:(NSUInteger)previousAmount { | 246 didChangeBufferedAmount:(NSUInteger)previousAmount { |
251 NSAssert(channel.bufferedAmount != previousAmount, | 247 NSAssert(channel.bufferedAmount != previousAmount, |
252 @"Invalid bufferedAmount change"); | 248 @"Invalid bufferedAmount change"); |
253 } | 249 } |
254 | 250 |
255 - (void)channel:(RTCDataChannel*)channel | 251 - (void)channel:(RTCDataChannel*)channel |
256 didReceiveMessageWithBuffer:(RTCDataBuffer*)buffer { | 252 didReceiveMessageWithBuffer:(RTCDataBuffer*)buffer { |
257 NSAssert([_expectedMessages count] > 0, | 253 NSAssert([_expectedMessages count] > 0, |
258 @"Unexpected message received"); | 254 @"Unexpected message received"); |
259 RTCDataBuffer* expectedBuffer = [_expectedMessages objectAtIndex:0]; | 255 RTCDataBuffer* expectedBuffer = [_expectedMessages objectAtIndex:0]; |
260 NSAssert(expectedBuffer.isBinary == buffer.isBinary, | 256 NSAssert(expectedBuffer.isBinary == buffer.isBinary, |
261 @"Buffer isBinary should match"); | 257 @"Buffer isBinary should match"); |
262 NSAssert([expectedBuffer.data isEqual:buffer.data], | 258 NSAssert([expectedBuffer.data isEqual:buffer.data], |
263 @"Buffer data should match"); | 259 @"Buffer data should match"); |
264 [_expectedMessages removeObjectAtIndex:0]; | 260 [_expectedMessages removeObjectAtIndex:0]; |
265 } | 261 } |
266 | 262 |
267 @end | 263 @end |
OLD | NEW |