Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2009 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2009 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 // Test a codec with a dynamic payload type. | 176 // Test a codec with a dynamic payload type. |
| 177 VideoCodec c1(96, "V"); | 177 VideoCodec c1(96, "V"); |
| 178 EXPECT_TRUE(c1.Matches(VideoCodec(96, "V"))); | 178 EXPECT_TRUE(c1.Matches(VideoCodec(96, "V"))); |
| 179 EXPECT_TRUE(c1.Matches(VideoCodec(97, "V"))); | 179 EXPECT_TRUE(c1.Matches(VideoCodec(97, "V"))); |
| 180 EXPECT_TRUE(c1.Matches(VideoCodec(96, "v"))); | 180 EXPECT_TRUE(c1.Matches(VideoCodec(96, "v"))); |
| 181 EXPECT_TRUE(c1.Matches(VideoCodec(97, "v"))); | 181 EXPECT_TRUE(c1.Matches(VideoCodec(97, "v"))); |
| 182 EXPECT_FALSE(c1.Matches(VideoCodec(96, ""))); | 182 EXPECT_FALSE(c1.Matches(VideoCodec(96, ""))); |
| 183 EXPECT_FALSE(c1.Matches(VideoCodec(95, "V"))); | 183 EXPECT_FALSE(c1.Matches(VideoCodec(95, "V"))); |
| 184 } | 184 } |
| 185 | 185 |
| 186 TEST(CodecTest, TestDataCodecMatches) { | 186 TEST_F(CodecTest, TestDataCodecMatches) { |
|
the sun
2016/10/25 08:40:38
Note: avoid fixtures if not needed, such as in thi
| |
| 187 // Test a codec with a static payload type. | 187 // Test a codec with a static payload type. |
| 188 DataCodec c0(95, "D"); | 188 DataCodec c0(95, "D"); |
| 189 EXPECT_TRUE(c0.Matches(DataCodec(95, ""))); | 189 EXPECT_TRUE(c0.Matches(DataCodec(95, ""))); |
| 190 EXPECT_FALSE(c0.Matches(DataCodec(96, ""))); | 190 EXPECT_FALSE(c0.Matches(DataCodec(96, ""))); |
| 191 | 191 |
| 192 // Test a codec with a dynamic payload type. | 192 // Test a codec with a dynamic payload type. |
| 193 DataCodec c1(96, "D"); | 193 DataCodec c1(96, "D"); |
| 194 EXPECT_TRUE(c1.Matches(DataCodec(96, "D"))); | 194 EXPECT_TRUE(c1.Matches(DataCodec(96, "D"))); |
| 195 EXPECT_TRUE(c1.Matches(DataCodec(97, "D"))); | 195 EXPECT_TRUE(c1.Matches(DataCodec(97, "D"))); |
| 196 EXPECT_TRUE(c1.Matches(DataCodec(96, "d"))); | 196 EXPECT_TRUE(c1.Matches(DataCodec(96, "d"))); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate); | 310 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate); |
| 311 EXPECT_EQ(1, codec_params_1.channels); | 311 EXPECT_EQ(1, codec_params_1.channels); |
| 312 | 312 |
| 313 const AudioCodec a(97, "A", 44100, 20000, 2); | 313 const AudioCodec a(97, "A", 44100, 20000, 2); |
| 314 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters(); | 314 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters(); |
| 315 EXPECT_EQ(97, codec_params_2.payload_type); | 315 EXPECT_EQ(97, codec_params_2.payload_type); |
| 316 EXPECT_EQ("A", codec_params_2.mime_type); | 316 EXPECT_EQ("A", codec_params_2.mime_type); |
| 317 EXPECT_EQ(44100, codec_params_2.clock_rate); | 317 EXPECT_EQ(44100, codec_params_2.clock_rate); |
| 318 EXPECT_EQ(2, codec_params_2.channels); | 318 EXPECT_EQ(2, codec_params_2.channels); |
| 319 } | 319 } |
| OLD | NEW |