| 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 29 matching lines...) Expand all Loading... |
| 40 nativeConstraints->GetOptional(); | 40 nativeConstraints->GetOptional(); |
| 41 [self expectConstraints:optional inNativeConstraints:nativeOptional]; | 41 [self expectConstraints:optional inNativeConstraints:nativeOptional]; |
| 42 } | 42 } |
| 43 | 43 |
| 44 - (void)expectConstraints:(NSDictionary *)constraints | 44 - (void)expectConstraints:(NSDictionary *)constraints |
| 45 inNativeConstraints: | 45 inNativeConstraints: |
| 46 (webrtc::MediaConstraintsInterface::Constraints)nativeConstraints { | 46 (webrtc::MediaConstraintsInterface::Constraints)nativeConstraints { |
| 47 EXPECT_EQ(constraints.count, nativeConstraints.size()); | 47 EXPECT_EQ(constraints.count, nativeConstraints.size()); |
| 48 | 48 |
| 49 for (NSString *key in constraints) { | 49 for (NSString *key in constraints) { |
| 50 NSString *value = constraints[key]; | 50 NSString *value = [constraints objectForKey:key]; |
| 51 | 51 |
| 52 std::string nativeValue; | 52 std::string nativeValue; |
| 53 bool found = nativeConstraints.FindFirst(key.stdString, &nativeValue); | 53 bool found = nativeConstraints.FindFirst(key.stdString, &nativeValue); |
| 54 EXPECT_TRUE(found); | 54 EXPECT_TRUE(found); |
| 55 EXPECT_EQ(value.stdString, nativeValue); | 55 EXPECT_EQ(value.stdString, nativeValue); |
| 56 } | 56 } |
| 57 } | 57 } |
| 58 | 58 |
| 59 @end | 59 @end |
| 60 | 60 |
| 61 TEST(RTCMediaConstraintsTest, MediaConstraintsTest) { | 61 TEST(RTCMediaConstraintsTest, MediaConstraintsTest) { |
| 62 @autoreleasepool { | 62 @autoreleasepool { |
| 63 RTCMediaConstraintsTest *test = [[RTCMediaConstraintsTest alloc] init]; | 63 RTCMediaConstraintsTest *test = [[RTCMediaConstraintsTest alloc] init]; |
| 64 [test testMediaConstraints]; | 64 [test testMediaConstraints]; |
| 65 } | 65 } |
| 66 } | 66 } |
| OLD | NEW |