OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 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 142 matching lines...) Loading... |
153 | 153 |
154 // valid media subtype, valid framerate | 154 // valid media subtype, valid framerate |
155 AVCaptureDeviceFormatMock* mock = [AVCaptureDeviceFormatMock validFormat]; | 155 AVCaptureDeviceFormatMock* mock = [AVCaptureDeviceFormatMock validFormat]; |
156 [[[mockDevice stub] andReturn:@[ mock ]] formats]; | 156 [[[mockDevice stub] andReturn:@[ mock ]] formats]; |
157 | 157 |
158 // when | 158 // when |
159 std::set<cricket::VideoFormat> result = | 159 std::set<cricket::VideoFormat> result = |
160 webrtc::GetSupportedVideoFormatsForDevice(mockDevice); | 160 webrtc::GetSupportedVideoFormatsForDevice(mockDevice); |
161 | 161 |
162 // then | 162 // then |
163 EXPECT_EQ(1, result.size()); | 163 EXPECT_EQ(1u, result.size()); |
164 | 164 |
165 // make sure the set has the expected format | 165 // make sure the set has the expected format |
166 EXPECT_EQ(expectedFormat, *result.begin()); | 166 EXPECT_EQ(expectedFormat, *result.begin()); |
167 } | 167 } |
168 | 168 |
169 TEST(AVFormatMapperTest, MediaSubtypePreference) { | 169 TEST(AVFormatMapperTest, MediaSubtypePreference) { |
170 // given | 170 // given |
171 id mockDevice = [OCMockObject mockForClass:[AVCaptureDevice class]]; | 171 id mockDevice = [OCMockObject mockForClass:[AVCaptureDevice class]]; |
172 | 172 |
173 // valid media subtype, valid framerate | 173 // valid media subtype, valid framerate |
(...skipping 60 matching lines...) Loading... |
234 [[mockDevice expect] unlockForConfiguration]; | 234 [[mockDevice expect] unlockForConfiguration]; |
235 | 235 |
236 // when | 236 // when |
237 bool resultFormat = webrtc::SetFormatForCaptureDevice(mockDevice, nil, | 237 bool resultFormat = webrtc::SetFormatForCaptureDevice(mockDevice, nil, |
238 cricket::VideoFormat()); | 238 cricket::VideoFormat()); |
239 | 239 |
240 // then | 240 // then |
241 EXPECT_FALSE(resultFormat); | 241 EXPECT_FALSE(resultFormat); |
242 [mockDevice verify]; | 242 [mockDevice verify]; |
243 } | 243 } |
OLD | NEW |