| 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 |
| 236 #pragma mark - RTCDataChannelDelegate | 240 #pragma mark - RTCDataChannelDelegate |
| 237 | 241 |
| 238 - (void)channelDidChangeState:(RTCDataChannel*)channel { | 242 - (void)channelDidChangeState:(RTCDataChannel*)channel { |
| 239 NSAssert([_expectedStateChanges count] > 0, | 243 NSAssert([_expectedStateChanges count] > 0, |
| 240 @"Unexpected state change"); | 244 @"Unexpected state change"); |
| 241 int expectedState = [self popFirstElementAsInt:_expectedStateChanges]; | 245 int expectedState = [self popFirstElementAsInt:_expectedStateChanges]; |
| 242 NSAssert(expectedState == channel.state, @"Channel state should match"); | 246 NSAssert(expectedState == channel.state, @"Channel state should match"); |
| 243 } | 247 } |
| 244 | 248 |
| 245 - (void)channel:(RTCDataChannel*)channel | 249 - (void)channel:(RTCDataChannel*)channel |
| 246 didChangeBufferedAmount:(NSUInteger)previousAmount { | 250 didChangeBufferedAmount:(NSUInteger)previousAmount { |
| 247 NSAssert(channel.bufferedAmount != previousAmount, | 251 NSAssert(channel.bufferedAmount != previousAmount, |
| 248 @"Invalid bufferedAmount change"); | 252 @"Invalid bufferedAmount change"); |
| 249 } | 253 } |
| 250 | 254 |
| 251 - (void)channel:(RTCDataChannel*)channel | 255 - (void)channel:(RTCDataChannel*)channel |
| 252 didReceiveMessageWithBuffer:(RTCDataBuffer*)buffer { | 256 didReceiveMessageWithBuffer:(RTCDataBuffer*)buffer { |
| 253 NSAssert([_expectedMessages count] > 0, | 257 NSAssert([_expectedMessages count] > 0, |
| 254 @"Unexpected message received"); | 258 @"Unexpected message received"); |
| 255 RTCDataBuffer* expectedBuffer = [_expectedMessages objectAtIndex:0]; | 259 RTCDataBuffer* expectedBuffer = [_expectedMessages objectAtIndex:0]; |
| 256 NSAssert(expectedBuffer.isBinary == buffer.isBinary, | 260 NSAssert(expectedBuffer.isBinary == buffer.isBinary, |
| 257 @"Buffer isBinary should match"); | 261 @"Buffer isBinary should match"); |
| 258 NSAssert([expectedBuffer.data isEqual:buffer.data], | 262 NSAssert([expectedBuffer.data isEqual:buffer.data], |
| 259 @"Buffer data should match"); | 263 @"Buffer data should match"); |
| 260 [_expectedMessages removeObjectAtIndex:0]; | 264 [_expectedMessages removeObjectAtIndex:0]; |
| 261 } | 265 } |
| 262 | 266 |
| 263 @end | 267 @end |
| OLD | NEW |