Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #import <Foundation/Foundation.h> | |
| 12 | |
| 13 #include "webrtc/base/gunit.h" | |
| 14 | |
| 15 #import "webrtc/api/objc/RTCDataChannelConfiguration.h" | |
| 16 #import "webrtc/api/objc/RTCDataChannelConfiguration+Private.h" | |
| 17 #import "webrtc/base/objc/NSString+StdString.h" | |
| 18 | |
| 19 @interface RTCDataChannelConfigurationTest : NSObject | |
| 20 - (void)testConversionToNativeDataChannelInit; | |
| 21 @end | |
| 22 | |
| 23 @implementation RTCDataChannelConfigurationTest | |
| 24 | |
| 25 - (void)testConversionToNativeDataChannelInit { | |
| 26 RTCDataChannelConfiguration *dataChannelConfig = | |
| 27 [[RTCDataChannelConfiguration alloc] init]; | |
| 28 dataChannelConfig.isOrdered = NO; | |
| 29 dataChannelConfig.maxPacketLifeTime = 5; | |
|
tkchin_webrtc
2016/01/26 20:12:43
consider using one variable for both setting the c
hjon_webrtc
2016/01/27 18:38:36
Done.
| |
| 30 dataChannelConfig.maxRetransmits = 4; | |
| 31 dataChannelConfig.isNegotiated = YES; | |
| 32 dataChannelConfig.streamId = 4; | |
| 33 dataChannelConfig.protocol = @"protocol"; | |
| 34 | |
| 35 webrtc::DataChannelInit nativeInit = dataChannelConfig.nativeDataChannelInit; | |
| 36 EXPECT_EQ(false, nativeInit.ordered); | |
| 37 EXPECT_EQ(5, nativeInit.maxRetransmitTime); | |
| 38 EXPECT_EQ(4, nativeInit.maxRetransmits); | |
| 39 EXPECT_EQ(true, nativeInit.negotiated); | |
| 40 EXPECT_EQ(4, nativeInit.id); | |
| 41 EXPECT_EQ("protocol", nativeInit.protocol); | |
| 42 } | |
| 43 | |
| 44 @end | |
| 45 | |
| 46 TEST(RTCDataChannelConfiguration, NativeDataChannelInitConversionTest) { | |
| 47 @autoreleasepool { | |
| 48 RTCDataChannelConfigurationTest *test = | |
| 49 [[RTCDataChannelConfigurationTest alloc] init]; | |
| 50 [test testConversionToNativeDataChannelInit]; | |
| 51 } | |
| 52 } | |
| OLD | NEW |