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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 #pragma mark - RTCDataChannelDelegate | 224 #pragma mark - RTCDataChannelDelegate |
225 | 225 |
226 - (void)channelDidChangeState:(RTCDataChannel*)channel { | 226 - (void)channelDidChangeState:(RTCDataChannel*)channel { |
227 NSAssert([_expectedStateChanges count] > 0, | 227 NSAssert([_expectedStateChanges count] > 0, |
228 @"Unexpected state change"); | 228 @"Unexpected state change"); |
229 int expectedState = [self popFirstElementAsInt:_expectedStateChanges]; | 229 int expectedState = [self popFirstElementAsInt:_expectedStateChanges]; |
230 NSAssert(expectedState == channel.state, @"Channel state should match"); | 230 NSAssert(expectedState == channel.state, @"Channel state should match"); |
231 } | 231 } |
232 | 232 |
| 233 - (void)channelDidChangeBufferedAmount:(RTCDataChannel*)channel |
| 234 previousAmount:(NSUInteger)previousAmount { |
| 235 NSAssert(channel.bufferedAmount != previousAmount, |
| 236 @"Invalid bufferedAmount change"); |
| 237 } |
| 238 |
233 - (void)channel:(RTCDataChannel*)channel | 239 - (void)channel:(RTCDataChannel*)channel |
234 didReceiveMessageWithBuffer:(RTCDataBuffer*)buffer { | 240 didReceiveMessageWithBuffer:(RTCDataBuffer*)buffer { |
235 NSAssert([_expectedMessages count] > 0, | 241 NSAssert([_expectedMessages count] > 0, |
236 @"Unexpected message received"); | 242 @"Unexpected message received"); |
237 RTCDataBuffer* expectedBuffer = [_expectedMessages objectAtIndex:0]; | 243 RTCDataBuffer* expectedBuffer = [_expectedMessages objectAtIndex:0]; |
238 NSAssert(expectedBuffer.isBinary == buffer.isBinary, | 244 NSAssert(expectedBuffer.isBinary == buffer.isBinary, |
239 @"Buffer isBinary should match"); | 245 @"Buffer isBinary should match"); |
240 NSAssert([expectedBuffer.data isEqual:buffer.data], | 246 NSAssert([expectedBuffer.data isEqual:buffer.data], |
241 @"Buffer data should match"); | 247 @"Buffer data should match"); |
242 [_expectedMessages removeObjectAtIndex:0]; | 248 [_expectedMessages removeObjectAtIndex:0]; |
243 } | 249 } |
244 | 250 |
245 @end | 251 @end |
OLD | NEW |