OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { | 169 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { |
170 voe_codec_->GetCodec(i, codec_instance_); | 170 voe_codec_->GetCodec(i, codec_instance_); |
171 if (!_stricmp("opus", codec_instance_.plname)) { | 171 if (!_stricmp("opus", codec_instance_.plname)) { |
172 continue; | 172 continue; |
173 } | 173 } |
174 voe_codec_->SetSendCodec(channel_, codec_instance_); | 174 voe_codec_->SetSendCodec(channel_, codec_instance_); |
175 EXPECT_EQ(-1, voe_codec_->SetOpusDtx(channel_, true)); | 175 EXPECT_EQ(-1, voe_codec_->SetOpusDtx(channel_, true)); |
176 } | 176 } |
177 } | 177 } |
178 | 178 |
| 179 #ifdef ENABLE_RTC_EVENT_LOG |
| 180 TEST_F(CodecTest, RtcEventLogIntegrationTest) { |
| 181 webrtc::RtcEventLog* event_log = voe_codec_->GetEventLog(); |
| 182 ASSERT_TRUE(event_log); |
| 183 |
| 184 // Find the name of the current test, in order to use it as a temporary |
| 185 // filename. |
| 186 auto test_info = ::testing::UnitTest::GetInstance()->current_test_info(); |
| 187 const std::string temp_filename = webrtc::test::OutputPath() + |
| 188 test_info->test_case_name() + |
| 189 test_info->name(); |
| 190 // Create a log file. |
| 191 event_log->StartLogging(temp_filename, 1000); |
| 192 event_log->StopLogging(); |
| 193 |
| 194 // Check if the file has been created. |
| 195 FILE* event_file = fopen(temp_filename.c_str(), "r"); |
| 196 ASSERT_TRUE(event_file); |
| 197 fclose(event_file); |
| 198 // Remove the temporary file. |
| 199 remove(temp_filename.c_str()); |
| 200 } |
| 201 #endif // ENABLE_RTC_EVENT_LOG |
| 202 |
179 // TODO(xians, phoglund): Re-enable when issue 372 is resolved. | 203 // TODO(xians, phoglund): Re-enable when issue 372 is resolved. |
180 TEST_F(CodecTest, DISABLED_ManualVerifySendCodecsForAllPacketSizes) { | 204 TEST_F(CodecTest, DISABLED_ManualVerifySendCodecsForAllPacketSizes) { |
181 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { | 205 for (int i = 0; i < voe_codec_->NumOfCodecs(); ++i) { |
182 voe_codec_->GetCodec(i, codec_instance_); | 206 voe_codec_->GetCodec(i, codec_instance_); |
183 if (IsNotViableSendCodec(codec_instance_.plname)) { | 207 if (IsNotViableSendCodec(codec_instance_.plname)) { |
184 TEST_LOG("Skipping %s.\n", codec_instance_.plname); | 208 TEST_LOG("Skipping %s.\n", codec_instance_.plname); |
185 continue; | 209 continue; |
186 } | 210 } |
187 EXPECT_NE(-1, codec_instance_.pltype) << | 211 EXPECT_NE(-1, codec_instance_.pltype) << |
188 "The codec database should suggest a payload type."; | 212 "The codec database should suggest a payload type."; |
(...skipping 17 matching lines...) Expand all Loading... |
206 TEST_LOG("%d ", packet_size); | 230 TEST_LOG("%d ", packet_size); |
207 TEST_LOG_FLUSH; | 231 TEST_LOG_FLUSH; |
208 at_least_one_succeeded = true; | 232 at_least_one_succeeded = true; |
209 Sleep(CODEC_TEST_TIME); | 233 Sleep(CODEC_TEST_TIME); |
210 } | 234 } |
211 } | 235 } |
212 TEST_LOG("\n"); | 236 TEST_LOG("\n"); |
213 EXPECT_TRUE(at_least_one_succeeded); | 237 EXPECT_TRUE(at_least_one_succeeded); |
214 } | 238 } |
215 } | 239 } |
OLD | NEW |