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 10 matching lines...) Expand all Loading... |
21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | 21 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | 22 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | 23 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | 24 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 #include "talk/app/webrtc/mediacontroller.h" | 28 #include "talk/app/webrtc/mediacontroller.h" |
29 #include "talk/media/base/fakecapturemanager.h" | 29 #include "talk/media/base/fakecapturemanager.h" |
30 #include "talk/media/base/fakemediaengine.h" | 30 #include "talk/media/base/fakemediaengine.h" |
| 31 #include "talk/media/base/fakevideocapturer.h" |
31 #include "talk/media/base/testutils.h" | 32 #include "talk/media/base/testutils.h" |
32 #include "talk/media/devices/fakedevicemanager.h" | |
33 #include "talk/media/webrtc/fakewebrtccall.h" | 33 #include "talk/media/webrtc/fakewebrtccall.h" |
34 #include "talk/session/media/channelmanager.h" | 34 #include "talk/session/media/channelmanager.h" |
35 #include "webrtc/base/gunit.h" | 35 #include "webrtc/base/gunit.h" |
36 #include "webrtc/base/logging.h" | 36 #include "webrtc/base/logging.h" |
37 #include "webrtc/base/thread.h" | 37 #include "webrtc/base/thread.h" |
38 #include "webrtc/p2p/base/faketransportcontroller.h" | 38 #include "webrtc/p2p/base/faketransportcontroller.h" |
39 | 39 |
40 namespace cricket { | 40 namespace cricket { |
41 | 41 |
42 static const AudioCodec kAudioCodecs[] = { | 42 static const AudioCodec kAudioCodecs[] = { |
(...skipping 18 matching lines...) Expand all Loading... |
61 private: | 61 private: |
62 webrtc::Call* call_; | 62 webrtc::Call* call_; |
63 }; | 63 }; |
64 | 64 |
65 class ChannelManagerTest : public testing::Test { | 65 class ChannelManagerTest : public testing::Test { |
66 protected: | 66 protected: |
67 ChannelManagerTest() | 67 ChannelManagerTest() |
68 : fake_call_(webrtc::Call::Config()), | 68 : fake_call_(webrtc::Call::Config()), |
69 fake_mc_(&fake_call_), | 69 fake_mc_(&fake_call_), |
70 fme_(NULL), | 70 fme_(NULL), |
71 fdm_(NULL), | |
72 fcm_(NULL), | 71 fcm_(NULL), |
73 cm_(NULL) {} | 72 cm_(NULL) {} |
74 | 73 |
75 virtual void SetUp() { | 74 virtual void SetUp() { |
76 fme_ = new cricket::FakeMediaEngine(); | 75 fme_ = new cricket::FakeMediaEngine(); |
77 fme_->SetAudioCodecs(MAKE_VECTOR(kAudioCodecs)); | 76 fme_->SetAudioCodecs(MAKE_VECTOR(kAudioCodecs)); |
78 fme_->SetVideoCodecs(MAKE_VECTOR(kVideoCodecs)); | 77 fme_->SetVideoCodecs(MAKE_VECTOR(kVideoCodecs)); |
79 fdme_ = new cricket::FakeDataEngine(); | 78 fdme_ = new cricket::FakeDataEngine(); |
80 fdm_ = new cricket::FakeDeviceManager(); | |
81 fcm_ = new cricket::FakeCaptureManager(); | 79 fcm_ = new cricket::FakeCaptureManager(); |
82 cm_ = new cricket::ChannelManager( | 80 cm_ = new cricket::ChannelManager( |
83 fme_, fdme_, fdm_, fcm_, rtc::Thread::Current()); | 81 fme_, fdme_, fcm_, rtc::Thread::Current()); |
84 transport_controller_ = | 82 transport_controller_ = |
85 new cricket::FakeTransportController(ICEROLE_CONTROLLING); | 83 new cricket::FakeTransportController(ICEROLE_CONTROLLING); |
86 | |
87 std::vector<std::string> in_device_list, out_device_list, vid_device_list; | |
88 in_device_list.push_back("audio-in1"); | |
89 in_device_list.push_back("audio-in2"); | |
90 out_device_list.push_back("audio-out1"); | |
91 out_device_list.push_back("audio-out2"); | |
92 vid_device_list.push_back("video-in1"); | |
93 vid_device_list.push_back("video-in2"); | |
94 fdm_->SetAudioInputDevices(in_device_list); | |
95 fdm_->SetAudioOutputDevices(out_device_list); | |
96 fdm_->SetVideoCaptureDevices(vid_device_list); | |
97 } | 84 } |
98 | 85 |
99 virtual void TearDown() { | 86 virtual void TearDown() { |
100 delete transport_controller_; | 87 delete transport_controller_; |
101 delete cm_; | 88 delete cm_; |
102 cm_ = NULL; | 89 cm_ = NULL; |
103 fdm_ = NULL; | |
104 fcm_ = NULL; | 90 fcm_ = NULL; |
105 fdme_ = NULL; | 91 fdme_ = NULL; |
106 fme_ = NULL; | 92 fme_ = NULL; |
107 } | 93 } |
108 | 94 |
109 rtc::Thread worker_; | 95 rtc::Thread worker_; |
110 cricket::FakeCall fake_call_; | 96 cricket::FakeCall fake_call_; |
111 cricket::FakeMediaController fake_mc_; | 97 cricket::FakeMediaController fake_mc_; |
112 cricket::FakeMediaEngine* fme_; | 98 cricket::FakeMediaEngine* fme_; |
113 cricket::FakeDataEngine* fdme_; | 99 cricket::FakeDataEngine* fdme_; |
114 cricket::FakeDeviceManager* fdm_; | |
115 cricket::FakeCaptureManager* fcm_; | 100 cricket::FakeCaptureManager* fcm_; |
116 cricket::ChannelManager* cm_; | 101 cricket::ChannelManager* cm_; |
117 cricket::FakeTransportController* transport_controller_; | 102 cricket::FakeTransportController* transport_controller_; |
118 }; | 103 }; |
119 | 104 |
120 // Test that we startup/shutdown properly. | 105 // Test that we startup/shutdown properly. |
121 TEST_F(ChannelManagerTest, StartupShutdown) { | 106 TEST_F(ChannelManagerTest, StartupShutdown) { |
122 EXPECT_FALSE(cm_->initialized()); | 107 EXPECT_FALSE(cm_->initialized()); |
123 EXPECT_EQ(rtc::Thread::Current(), cm_->worker_thread()); | 108 EXPECT_EQ(rtc::Thread::Current(), cm_->worker_thread()); |
124 EXPECT_TRUE(cm_->Init()); | 109 EXPECT_TRUE(cm_->Init()); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 } | 212 } |
228 GetCapturerFrameSize(VideoCapturer* capturer) : width(0), height(0) { | 213 GetCapturerFrameSize(VideoCapturer* capturer) : width(0), height(0) { |
229 capturer->SignalVideoFrame.connect(this, | 214 capturer->SignalVideoFrame.connect(this, |
230 &GetCapturerFrameSize::OnVideoFrame); | 215 &GetCapturerFrameSize::OnVideoFrame); |
231 static_cast<FakeVideoCapturer*>(capturer)->CaptureFrame(); | 216 static_cast<FakeVideoCapturer*>(capturer)->CaptureFrame(); |
232 } | 217 } |
233 size_t width; | 218 size_t width; |
234 size_t height; | 219 size_t height; |
235 }; | 220 }; |
236 | 221 |
237 TEST_F(ChannelManagerTest, DefaultCapturerAspectRatio) { | |
238 VideoCodec codec(100, "VP8", 640, 360, 30, 0); | |
239 VideoFormat format(640, 360, 33, FOURCC_ANY); | |
240 VideoEncoderConfig config(codec, 1, 2); | |
241 EXPECT_TRUE(cm_->Init()); | |
242 // A capturer created before the default encoder config is set will have no | |
243 // set aspect ratio, so it'll be 4:3 (based on the fake video capture impl). | |
244 VideoCapturer* capturer = cm_->CreateVideoCapturer(); | |
245 ASSERT_TRUE(capturer != NULL); | |
246 EXPECT_EQ(CS_RUNNING, capturer->Start(format)); | |
247 GetCapturerFrameSize size(capturer); | |
248 EXPECT_EQ(640u, size.width); | |
249 EXPECT_EQ(480u, size.height); | |
250 delete capturer; | |
251 // Try again, but with the encoder config set to 16:9. | |
252 EXPECT_TRUE(cm_->SetDefaultVideoEncoderConfig(config)); | |
253 capturer = cm_->CreateVideoCapturer(); | |
254 ASSERT_TRUE(capturer != NULL); | |
255 EXPECT_EQ(CS_RUNNING, capturer->Start(format)); | |
256 GetCapturerFrameSize cropped_size(capturer); | |
257 EXPECT_EQ(640u, cropped_size.width); | |
258 EXPECT_EQ(360u, cropped_size.height); | |
259 delete capturer; | |
260 } | |
261 | |
262 // Test that SetDefaultVideoCodec passes through the right values. | 222 // Test that SetDefaultVideoCodec passes through the right values. |
263 TEST_F(ChannelManagerTest, SetDefaultVideoCodecBeforeInit) { | 223 TEST_F(ChannelManagerTest, SetDefaultVideoCodecBeforeInit) { |
264 cricket::VideoCodec codec(96, "G264", 1280, 720, 60, 0); | 224 cricket::VideoCodec codec(96, "G264", 1280, 720, 60, 0); |
265 cricket::VideoEncoderConfig config(codec, 1, 2); | 225 cricket::VideoEncoderConfig config(codec, 1, 2); |
266 EXPECT_TRUE(cm_->SetDefaultVideoEncoderConfig(config)); | 226 EXPECT_TRUE(cm_->SetDefaultVideoEncoderConfig(config)); |
267 EXPECT_TRUE(cm_->Init()); | 227 EXPECT_TRUE(cm_->Init()); |
268 EXPECT_EQ(config, fme_->default_video_encoder_config()); | 228 EXPECT_EQ(config, fme_->default_video_encoder_config()); |
269 } | 229 } |
270 | 230 |
271 TEST_F(ChannelManagerTest, SetAudioOptionsBeforeInit) { | |
272 // Test that values that we set before Init are applied. | |
273 AudioOptions options; | |
274 options.auto_gain_control.Set(true); | |
275 options.echo_cancellation.Set(false); | |
276 EXPECT_TRUE(cm_->SetAudioOptions("audio-in1", "audio-out1", options)); | |
277 std::string audio_in, audio_out; | |
278 AudioOptions set_options; | |
279 // Check options before Init. | |
280 EXPECT_TRUE(cm_->GetAudioOptions(&audio_in, &audio_out, &set_options)); | |
281 EXPECT_EQ("audio-in1", audio_in); | |
282 EXPECT_EQ("audio-out1", audio_out); | |
283 EXPECT_EQ(options, set_options); | |
284 EXPECT_TRUE(cm_->Init()); | |
285 // Check options after Init. | |
286 EXPECT_TRUE(cm_->GetAudioOptions(&audio_in, &audio_out, &set_options)); | |
287 EXPECT_EQ("audio-in1", audio_in); | |
288 EXPECT_EQ("audio-out1", audio_out); | |
289 EXPECT_EQ(options, set_options); | |
290 // At this point, the media engine should also be initialized. | |
291 EXPECT_EQ(options, fme_->audio_options()); | |
292 EXPECT_EQ(cricket::kDefaultAudioDelayOffset, | |
293 fme_->audio_delay_offset()); | |
294 } | |
295 | |
296 TEST_F(ChannelManagerTest, GetAudioOptionsWithNullParameters) { | |
297 std::string audio_in, audio_out; | |
298 AudioOptions options; | |
299 options.echo_cancellation.Set(true); | |
300 EXPECT_TRUE(cm_->SetAudioOptions("audio-in2", "audio-out2", options)); | |
301 EXPECT_TRUE(cm_->GetAudioOptions(&audio_in, NULL, NULL)); | |
302 EXPECT_EQ("audio-in2", audio_in); | |
303 EXPECT_TRUE(cm_->GetAudioOptions(NULL, &audio_out, NULL)); | |
304 EXPECT_EQ("audio-out2", audio_out); | |
305 AudioOptions out_options; | |
306 EXPECT_TRUE(cm_->GetAudioOptions(NULL, NULL, &out_options)); | |
307 bool echo_cancellation = false; | |
308 EXPECT_TRUE(out_options.echo_cancellation.Get(&echo_cancellation)); | |
309 EXPECT_TRUE(echo_cancellation); | |
310 } | |
311 | |
312 TEST_F(ChannelManagerTest, SetAudioOptions) { | |
313 // Test initial state. | |
314 EXPECT_TRUE(cm_->Init()); | |
315 EXPECT_EQ(std::string(cricket::DeviceManagerInterface::kDefaultDeviceName), | |
316 fme_->audio_in_device()); | |
317 EXPECT_EQ(std::string(cricket::DeviceManagerInterface::kDefaultDeviceName), | |
318 fme_->audio_out_device()); | |
319 EXPECT_EQ(cricket::kDefaultAudioDelayOffset, | |
320 fme_->audio_delay_offset()); | |
321 // Test setting specific values. | |
322 AudioOptions options; | |
323 options.auto_gain_control.Set(true); | |
324 EXPECT_TRUE(cm_->SetAudioOptions("audio-in1", "audio-out1", options)); | |
325 EXPECT_EQ("audio-in1", fme_->audio_in_device()); | |
326 EXPECT_EQ("audio-out1", fme_->audio_out_device()); | |
327 bool auto_gain_control = false; | |
328 EXPECT_TRUE( | |
329 fme_->audio_options().auto_gain_control.Get(&auto_gain_control)); | |
330 EXPECT_TRUE(auto_gain_control); | |
331 EXPECT_EQ(cricket::kDefaultAudioDelayOffset, | |
332 fme_->audio_delay_offset()); | |
333 // Test setting bad values. | |
334 EXPECT_FALSE(cm_->SetAudioOptions("audio-in9", "audio-out2", options)); | |
335 } | |
336 | |
337 TEST_F(ChannelManagerTest, SetCaptureDeviceBeforeInit) { | |
338 // Test that values that we set before Init are applied. | |
339 EXPECT_TRUE(cm_->SetCaptureDevice("video-in2")); | |
340 EXPECT_TRUE(cm_->Init()); | |
341 EXPECT_EQ("video-in2", cm_->video_device_name()); | |
342 } | |
343 | |
344 TEST_F(ChannelManagerTest, GetCaptureDeviceBeforeInit) { | |
345 std::string video_in; | |
346 // Test that GetCaptureDevice works before Init. | |
347 EXPECT_TRUE(cm_->SetCaptureDevice("video-in1")); | |
348 EXPECT_TRUE(cm_->GetCaptureDevice(&video_in)); | |
349 EXPECT_EQ("video-in1", video_in); | |
350 // Test that options set before Init can be gotten after Init. | |
351 EXPECT_TRUE(cm_->SetCaptureDevice("video-in2")); | |
352 EXPECT_TRUE(cm_->Init()); | |
353 EXPECT_TRUE(cm_->GetCaptureDevice(&video_in)); | |
354 EXPECT_EQ("video-in2", video_in); | |
355 } | |
356 | |
357 TEST_F(ChannelManagerTest, SetCaptureDevice) { | |
358 // Test setting defaults. | |
359 EXPECT_TRUE(cm_->Init()); | |
360 EXPECT_TRUE(cm_->SetCaptureDevice("")); // will use DeviceManager default | |
361 EXPECT_EQ("video-in1", cm_->video_device_name()); | |
362 // Test setting specific values. | |
363 EXPECT_TRUE(cm_->SetCaptureDevice("video-in2")); | |
364 EXPECT_EQ("video-in2", cm_->video_device_name()); | |
365 // TODO(juberti): Add test for invalid value here. | |
366 } | |
367 | |
368 // Test unplugging and plugging back the preferred devices. When the preferred | |
369 // device is unplugged, we fall back to the default device. When the preferred | |
370 // device is plugged back, we use it. | |
371 TEST_F(ChannelManagerTest, SetAudioOptionsUnplugPlug) { | |
372 // Set preferences "audio-in1" and "audio-out1" before init. | |
373 AudioOptions options; | |
374 EXPECT_TRUE(cm_->SetAudioOptions("audio-in1", "audio-out1", options)); | |
375 // Unplug device "audio-in1" and "audio-out1". | |
376 std::vector<std::string> in_device_list, out_device_list; | |
377 in_device_list.push_back("audio-in2"); | |
378 out_device_list.push_back("audio-out2"); | |
379 fdm_->SetAudioInputDevices(in_device_list); | |
380 fdm_->SetAudioOutputDevices(out_device_list); | |
381 // Init should fall back to default devices. | |
382 EXPECT_TRUE(cm_->Init()); | |
383 // The media engine should use the default. | |
384 EXPECT_EQ("", fme_->audio_in_device()); | |
385 EXPECT_EQ("", fme_->audio_out_device()); | |
386 // The channel manager keeps the preferences "audio-in1" and "audio-out1". | |
387 std::string audio_in, audio_out; | |
388 EXPECT_TRUE(cm_->GetAudioOptions(&audio_in, &audio_out, NULL)); | |
389 EXPECT_EQ("audio-in1", audio_in); | |
390 EXPECT_EQ("audio-out1", audio_out); | |
391 cm_->Terminate(); | |
392 | |
393 // Plug devices "audio-in2" and "audio-out2" back. | |
394 in_device_list.push_back("audio-in1"); | |
395 out_device_list.push_back("audio-out1"); | |
396 fdm_->SetAudioInputDevices(in_device_list); | |
397 fdm_->SetAudioOutputDevices(out_device_list); | |
398 // Init again. The preferences, "audio-in2" and "audio-out2", are used. | |
399 EXPECT_TRUE(cm_->Init()); | |
400 EXPECT_EQ("audio-in1", fme_->audio_in_device()); | |
401 EXPECT_EQ("audio-out1", fme_->audio_out_device()); | |
402 EXPECT_TRUE(cm_->GetAudioOptions(&audio_in, &audio_out, NULL)); | |
403 EXPECT_EQ("audio-in1", audio_in); | |
404 EXPECT_EQ("audio-out1", audio_out); | |
405 } | |
406 | |
407 // We have one camera. Unplug it, fall back to no camera. | |
408 TEST_F(ChannelManagerTest, SetCaptureDeviceUnplugPlugOneCamera) { | |
409 // Set preferences "video-in1" before init. | |
410 std::vector<std::string> vid_device_list; | |
411 vid_device_list.push_back("video-in1"); | |
412 fdm_->SetVideoCaptureDevices(vid_device_list); | |
413 EXPECT_TRUE(cm_->SetCaptureDevice("video-in1")); | |
414 | |
415 // Unplug "video-in1". | |
416 vid_device_list.clear(); | |
417 fdm_->SetVideoCaptureDevices(vid_device_list); | |
418 | |
419 // Init should fall back to avatar. | |
420 EXPECT_TRUE(cm_->Init()); | |
421 // The media engine should use no camera. | |
422 EXPECT_EQ("", cm_->video_device_name()); | |
423 // The channel manager keeps the user preference "video-in". | |
424 std::string video_in; | |
425 EXPECT_TRUE(cm_->GetCaptureDevice(&video_in)); | |
426 EXPECT_EQ("video-in1", video_in); | |
427 cm_->Terminate(); | |
428 | |
429 // Plug device "video-in1" back. | |
430 vid_device_list.push_back("video-in1"); | |
431 fdm_->SetVideoCaptureDevices(vid_device_list); | |
432 // Init again. The user preferred device, "video-in1", is used. | |
433 EXPECT_TRUE(cm_->Init()); | |
434 EXPECT_EQ("video-in1", cm_->video_device_name()); | |
435 EXPECT_TRUE(cm_->GetCaptureDevice(&video_in)); | |
436 EXPECT_EQ("video-in1", video_in); | |
437 } | |
438 | |
439 // We have multiple cameras. Unplug the preferred, fall back to another camera. | |
440 TEST_F(ChannelManagerTest, SetCaptureDeviceUnplugPlugTwoDevices) { | |
441 // Set video device to "video-in1" before init. | |
442 EXPECT_TRUE(cm_->SetCaptureDevice("video-in1")); | |
443 // Unplug device "video-in1". | |
444 std::vector<std::string> vid_device_list; | |
445 vid_device_list.push_back("video-in2"); | |
446 fdm_->SetVideoCaptureDevices(vid_device_list); | |
447 // Init should fall back to default device "video-in2". | |
448 EXPECT_TRUE(cm_->Init()); | |
449 // The media engine should use the default device "video-in2". | |
450 EXPECT_EQ("video-in2", cm_->video_device_name()); | |
451 // The channel manager keeps the user preference "video-in". | |
452 std::string video_in; | |
453 EXPECT_TRUE(cm_->GetCaptureDevice(&video_in)); | |
454 EXPECT_EQ("video-in1", video_in); | |
455 cm_->Terminate(); | |
456 | |
457 // Plug device "video-in1" back. | |
458 vid_device_list.push_back("video-in1"); | |
459 fdm_->SetVideoCaptureDevices(vid_device_list); | |
460 // Init again. The user preferred device, "video-in1", is used. | |
461 EXPECT_TRUE(cm_->Init()); | |
462 EXPECT_EQ("video-in1", cm_->video_device_name()); | |
463 EXPECT_TRUE(cm_->GetCaptureDevice(&video_in)); | |
464 EXPECT_EQ("video-in1", video_in); | |
465 } | |
466 | |
467 TEST_F(ChannelManagerTest, GetCaptureDevice) { | |
468 std::string video_in; | |
469 // Test setting/getting defaults. | |
470 EXPECT_TRUE(cm_->Init()); | |
471 EXPECT_TRUE(cm_->SetCaptureDevice("")); | |
472 EXPECT_TRUE(cm_->GetCaptureDevice(&video_in)); | |
473 EXPECT_EQ("video-in1", video_in); | |
474 // Test setting/getting specific values. | |
475 EXPECT_TRUE(cm_->SetCaptureDevice("video-in2")); | |
476 EXPECT_TRUE(cm_->GetCaptureDevice(&video_in)); | |
477 EXPECT_EQ("video-in2", video_in); | |
478 } | |
479 | |
480 TEST_F(ChannelManagerTest, GetSetOutputVolumeBeforeInit) { | 231 TEST_F(ChannelManagerTest, GetSetOutputVolumeBeforeInit) { |
481 int level; | 232 int level; |
482 // Before init, SetOutputVolume() remembers the volume but does not change the | 233 // Before init, SetOutputVolume() remembers the volume but does not change the |
483 // volume of the engine. GetOutputVolume() should fail. | 234 // volume of the engine. GetOutputVolume() should fail. |
484 EXPECT_EQ(-1, fme_->output_volume()); | 235 EXPECT_EQ(-1, fme_->output_volume()); |
485 EXPECT_FALSE(cm_->GetOutputVolume(&level)); | 236 EXPECT_FALSE(cm_->GetOutputVolume(&level)); |
486 EXPECT_FALSE(cm_->SetOutputVolume(-1)); // Invalid volume. | 237 EXPECT_FALSE(cm_->SetOutputVolume(-1)); // Invalid volume. |
487 EXPECT_TRUE(cm_->SetOutputVolume(99)); | 238 EXPECT_TRUE(cm_->SetOutputVolume(99)); |
488 EXPECT_EQ(-1, fme_->output_volume()); | 239 EXPECT_EQ(-1, fme_->output_volume()); |
489 | 240 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 EXPECT_FALSE(cm_->SetVideoRtxEnabled(false)); | 314 EXPECT_FALSE(cm_->SetVideoRtxEnabled(false)); |
564 | 315 |
565 // Can set again after terminate. | 316 // Can set again after terminate. |
566 cm_->Terminate(); | 317 cm_->Terminate(); |
567 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); | 318 EXPECT_TRUE(cm_->SetVideoRtxEnabled(true)); |
568 cm_->GetSupportedVideoCodecs(&codecs); | 319 cm_->GetSupportedVideoCodecs(&codecs); |
569 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); | 320 EXPECT_TRUE(ContainsMatchingCodec(codecs, rtx_codec)); |
570 } | 321 } |
571 | 322 |
572 } // namespace cricket | 323 } // namespace cricket |
OLD | NEW |