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 |
11 #include "webrtc/api/mediaconstraintsinterface.h" | 11 #include "webrtc/api/mediaconstraintsinterface.h" |
12 | 12 |
13 #include "webrtc/api/test/fakeconstraints.h" | 13 #include "webrtc/api/test/fakeconstraints.h" |
14 #include "webrtc/base/gunit.h" | 14 #include "webrtc/base/gunit.h" |
15 | 15 |
16 namespace webrtc { | 16 namespace webrtc { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 bool Matches(const PeerConnectionInterface::RTCConfiguration& a, | 20 bool Matches(const PeerConnectionInterface::RTCConfiguration& a, |
21 const PeerConnectionInterface::RTCConfiguration& b) { | 21 const PeerConnectionInterface::RTCConfiguration& b) { |
22 return a.audio_jitter_buffer_max_packets == | 22 return a.audio_jitter_buffer_max_packets == |
23 b.audio_jitter_buffer_max_packets && | 23 b.audio_jitter_buffer_max_packets && |
24 a.disable_prerenderer_smoothing == b.disable_prerenderer_smoothing; | 24 a.media_config.video.disable_prerenderer_smoothing == |
25 b.media_config.video.disable_prerenderer_smoothing; | |
hta-webrtc
2016/03/21 14:38:21
The Matches function was written to detect conspic
| |
25 } | 26 } |
26 | 27 |
27 TEST(MediaConstraintsInterface, CopyConstraintsIntoRtcConfiguration) { | 28 TEST(MediaConstraintsInterface, CopyConstraintsIntoRtcConfiguration) { |
28 FakeConstraints constraints; | 29 FakeConstraints constraints; |
29 PeerConnectionInterface::RTCConfiguration old_configuration; | 30 PeerConnectionInterface::RTCConfiguration old_configuration; |
30 PeerConnectionInterface::RTCConfiguration configuration; | 31 PeerConnectionInterface::RTCConfiguration configuration; |
31 | 32 |
32 CopyConstraintsIntoRtcConfiguration(&constraints, &configuration); | 33 CopyConstraintsIntoRtcConfiguration(&constraints, &configuration); |
33 EXPECT_TRUE(Matches(old_configuration, configuration)); | 34 EXPECT_TRUE(Matches(old_configuration, configuration)); |
34 | 35 |
(...skipping 18 matching lines...) Expand all Loading... | |
53 configuration.audio_jitter_buffer_max_packets = 34; | 54 configuration.audio_jitter_buffer_max_packets = 34; |
54 CopyConstraintsIntoRtcConfiguration(&constraints, &configuration); | 55 CopyConstraintsIntoRtcConfiguration(&constraints, &configuration); |
55 EXPECT_EQ(34, configuration.audio_jitter_buffer_max_packets); | 56 EXPECT_EQ(34, configuration.audio_jitter_buffer_max_packets); |
56 ASSERT_TRUE(configuration.enable_dtls_srtp); | 57 ASSERT_TRUE(configuration.enable_dtls_srtp); |
57 EXPECT_TRUE(*(configuration.enable_dtls_srtp)); | 58 EXPECT_TRUE(*(configuration.enable_dtls_srtp)); |
58 } | 59 } |
59 | 60 |
60 } // namespace | 61 } // namespace |
61 | 62 |
62 } // namespace webrtc | 63 } // namespace webrtc |
OLD | NEW |