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