OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2008 Google Inc. | 3 * Copyright 2008 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 EXPECT_TRUE(cm_->GetOutputVolume(&level)); | 243 EXPECT_TRUE(cm_->GetOutputVolume(&level)); |
244 EXPECT_EQ(level, fme_->output_volume()); | 244 EXPECT_EQ(level, fme_->output_volume()); |
245 | 245 |
246 EXPECT_FALSE(cm_->SetOutputVolume(-1)); // Invalid volume. | 246 EXPECT_FALSE(cm_->SetOutputVolume(-1)); // Invalid volume. |
247 EXPECT_TRUE(cm_->SetOutputVolume(60)); | 247 EXPECT_TRUE(cm_->SetOutputVolume(60)); |
248 EXPECT_EQ(60, fme_->output_volume()); | 248 EXPECT_EQ(60, fme_->output_volume()); |
249 EXPECT_TRUE(cm_->GetOutputVolume(&level)); | 249 EXPECT_TRUE(cm_->GetOutputVolume(&level)); |
250 EXPECT_EQ(60, level); | 250 EXPECT_EQ(60, level); |
251 } | 251 } |
252 | 252 |
253 // Test that logging options set before Init are applied properly, | |
254 // and retained even after Init. | |
255 TEST_F(ChannelManagerTest, SetLoggingBeforeInit) { | |
256 cm_->SetVoiceLogging(rtc::LS_INFO, "test-voice"); | |
257 cm_->SetVideoLogging(rtc::LS_VERBOSE, "test-video"); | |
258 EXPECT_EQ(rtc::LS_INFO, fme_->voice_loglevel()); | |
259 EXPECT_STREQ("test-voice", fme_->voice_logfilter().c_str()); | |
260 EXPECT_EQ(rtc::LS_VERBOSE, fme_->video_loglevel()); | |
261 EXPECT_STREQ("test-video", fme_->video_logfilter().c_str()); | |
262 EXPECT_TRUE(cm_->Init()); | |
263 EXPECT_EQ(rtc::LS_INFO, fme_->voice_loglevel()); | |
264 EXPECT_STREQ("test-voice", fme_->voice_logfilter().c_str()); | |
265 EXPECT_EQ(rtc::LS_VERBOSE, fme_->video_loglevel()); | |
266 EXPECT_STREQ("test-video", fme_->video_logfilter().c_str()); | |
267 } | |
268 | |
269 // Test that logging options set after Init are applied properly. | |
270 TEST_F(ChannelManagerTest, SetLogging) { | |
271 EXPECT_TRUE(cm_->Init()); | |
272 cm_->SetVoiceLogging(rtc::LS_INFO, "test-voice"); | |
273 cm_->SetVideoLogging(rtc::LS_VERBOSE, "test-video"); | |
274 EXPECT_EQ(rtc::LS_INFO, fme_->voice_loglevel()); | |
275 EXPECT_STREQ("test-voice", fme_->voice_logfilter().c_str()); | |
276 EXPECT_EQ(rtc::LS_VERBOSE, fme_->video_loglevel()); | |
277 EXPECT_STREQ("test-video", fme_->video_logfilter().c_str()); | |
278 } | |
279 | |
280 TEST_F(ChannelManagerTest, SetVideoRtxEnabled) { | 253 TEST_F(ChannelManagerTest, SetVideoRtxEnabled) { |
281 std::vector<VideoCodec> codecs; | 254 std::vector<VideoCodec> codecs; |
282 const VideoCodec rtx_codec(96, "rtx", 0, 0, 0, 0); | 255 const VideoCodec rtx_codec(96, "rtx", 0, 0, 0, 0); |
283 | 256 |
284 // By default RTX is disabled. | 257 // By default RTX is disabled. |
285 cm_->GetSupportedVideoCodecs(&codecs); | 258 cm_->GetSupportedVideoCodecs(&codecs); |
286 EXPECT_FALSE(ContainsMatchingCodec(codecs, rtx_codec)); | 259 EXPECT_FALSE(ContainsMatchingCodec(codecs, rtx_codec)); |
287 | 260 |
288 // Enable and check. | 261 // Enable and check. |
289 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); | 262 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); |
(...skipping 11 matching lines...) Expand all Loading... |
301 EXPECT_FALSE(cm_->SetVideoRtxEnabled(false)); | 274 EXPECT_FALSE(cm_->SetVideoRtxEnabled(false)); |
302 | 275 |
303 // Can set again after terminate. | 276 // Can set again after terminate. |
304 cm_->Terminate(); | 277 cm_->Terminate(); |
305 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); | 278 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); |
306 cm_->GetSupportedVideoCodecs(&codecs); | 279 cm_->GetSupportedVideoCodecs(&codecs); |
307 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); | 280 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); |
308 } | 281 } |
309 | 282 |
310 } // namespace cricket | 283 } // namespace cricket |
OLD | NEW |