Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 | 52 |
| 53 RTCMediaConstraints *contraints = [[RTCMediaConstraints alloc] initWithMandato ryConstraints:@{} | 53 RTCMediaConstraints *contraints = [[RTCMediaConstraints alloc] initWithMandato ryConstraints:@{} |
| 54 optionalConstraints:nil]; | 54 optionalConstraints:nil]; |
| 55 RTCPeerConnectionFactory *factory = [[RTCPeerConnectionFactory alloc] init]; | 55 RTCPeerConnectionFactory *factory = [[RTCPeerConnectionFactory alloc] init]; |
| 56 | 56 |
| 57 RTCConfiguration *newConfig; | 57 RTCConfiguration *newConfig; |
| 58 @autoreleasepool { | 58 @autoreleasepool { |
| 59 RTCPeerConnection *peerConnection = | 59 RTCPeerConnection *peerConnection = |
| 60 [factory peerConnectionWithConfiguration:config constraints:contraints d elegate:nil]; | 60 [factory peerConnectionWithConfiguration:config constraints:contraints d elegate:nil]; |
| 61 newConfig = peerConnection.configuration; | 61 newConfig = peerConnection.configuration; |
| 62 | |
| 63 EXPECT_TRUE([peerConnection setBitrateToMin:[NSNumber numberWithInt:100000] | |
| 64 toCurrent:[NSNumber numberWithInt:5000000] | |
| 65 toMax:[NSNumber numberWithInt:50000000 0]]); | |
| 66 EXPECT_FALSE([peerConnection setBitrateToMin:[NSNumber numberWithInt:2] | |
| 67 toCurrent:[NSNumber numberWithInt:1] | |
| 68 toMax:nullptr]); | |
|
tkchin_webrtc
2017/08/31 21:20:48
nil not nullptr
nil is for objc objects and means
| |
| 62 } | 69 } |
| 70 | |
| 63 EXPECT_EQ([config.iceServers count], [newConfig.iceServers count]); | 71 EXPECT_EQ([config.iceServers count], [newConfig.iceServers count]); |
| 64 RTCIceServer *newServer = newConfig.iceServers[0]; | 72 RTCIceServer *newServer = newConfig.iceServers[0]; |
| 65 RTCIceServer *origServer = config.iceServers[0]; | 73 RTCIceServer *origServer = config.iceServers[0]; |
| 66 std::string origUrl = origServer.urlStrings.firstObject.UTF8String; | 74 std::string origUrl = origServer.urlStrings.firstObject.UTF8String; |
| 67 std::string url = newServer.urlStrings.firstObject.UTF8String; | 75 std::string url = newServer.urlStrings.firstObject.UTF8String; |
| 68 EXPECT_EQ(origUrl, url); | 76 EXPECT_EQ(origUrl, url); |
| 69 | 77 |
| 70 EXPECT_EQ(config.iceTransportPolicy, newConfig.iceTransportPolicy); | 78 EXPECT_EQ(config.iceTransportPolicy, newConfig.iceTransportPolicy); |
| 71 EXPECT_EQ(config.bundlePolicy, newConfig.bundlePolicy); | 79 EXPECT_EQ(config.bundlePolicy, newConfig.bundlePolicy); |
| 72 EXPECT_EQ(config.rtcpMuxPolicy, newConfig.rtcpMuxPolicy); | 80 EXPECT_EQ(config.rtcpMuxPolicy, newConfig.rtcpMuxPolicy); |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 84 @end | 92 @end |
| 85 | 93 |
| 86 TEST(RTCPeerConnectionTest, ConfigurationGetterTest) { | 94 TEST(RTCPeerConnectionTest, ConfigurationGetterTest) { |
| 87 @autoreleasepool { | 95 @autoreleasepool { |
| 88 RTCPeerConnectionTest *test = [[RTCPeerConnectionTest alloc] init]; | 96 RTCPeerConnectionTest *test = [[RTCPeerConnectionTest alloc] init]; |
| 89 [test testConfigurationGetter]; | 97 [test testConfigurationGetter]; |
| 90 } | 98 } |
| 91 } | 99 } |
| 92 | 100 |
| 93 | 101 |
| OLD | NEW |