Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: content/browser/renderer_host/media/media_devices_manager_unittest.cc

Issue 2769543002: [Mojo Video Capture] Introduce abstraction VideoCaptureSystem (Closed)
Patch Set: Incorporated suggestions from PatchSet 5 Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/media_devices_manager.h" 5 #include "content/browser/renderer_host/media/media_devices_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 const MediaDeviceEnumeration& result) { 136 const MediaDeviceEnumeration& result) {
137 MockCallback(result); 137 MockCallback(result);
138 run_loop->Quit(); 138 run_loop->Quit();
139 } 139 }
140 140
141 protected: 141 protected:
142 void SetUp() override { 142 void SetUp() override {
143 audio_manager_.reset(new MockAudioManager()); 143 audio_manager_.reset(new MockAudioManager());
144 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); 144 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
145 video_capture_manager_ = new VideoCaptureManager( 145 video_capture_manager_ = new VideoCaptureManager(
146 std::unique_ptr<media::VideoCaptureDeviceFactory>( 146 base::MakeUnique<media::VideoCaptureSystem>(
147 new MockVideoCaptureDeviceFactory()), 147 std::unique_ptr<media::VideoCaptureDeviceFactory>(
148 new MockVideoCaptureDeviceFactory())),
148 base::ThreadTaskRunnerHandle::Get()); 149 base::ThreadTaskRunnerHandle::Get());
149 video_capture_device_factory_ = static_cast<MockVideoCaptureDeviceFactory*>( 150 video_capture_device_factory_ = static_cast<MockVideoCaptureDeviceFactory*>(
150 video_capture_manager_->video_capture_device_factory()); 151 video_capture_manager_->video_capture_device_factory());
151 media_devices_manager_.reset(new MediaDevicesManager( 152 media_devices_manager_.reset(new MediaDevicesManager(
152 audio_system_.get(), video_capture_manager_, nullptr)); 153 audio_system_.get(), video_capture_manager_, nullptr));
153 } 154 }
154 155
155 void EnableCache(MediaDeviceType type) { 156 void EnableCache(MediaDeviceType type) {
156 media_devices_manager_->SetCachePolicy( 157 media_devices_manager_->SetCachePolicy(
157 type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR); 158 type, MediaDevicesManager::CachePolicy::SYSTEM_MONITOR);
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO); 570 media_devices_manager_->OnDevicesChanged(base::SystemMonitor::DEVTYPE_AUDIO);
570 media_devices_manager_->OnDevicesChanged( 571 media_devices_manager_->OnDevicesChanged(
571 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE); 572 base::SystemMonitor::DEVTYPE_VIDEO_CAPTURE);
572 base::RunLoop().RunUntilIdle(); 573 base::RunLoop().RunUntilIdle();
573 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size()); 574 EXPECT_EQ(num_audio_input_devices, notification_all_audio_input.size());
574 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size()); 575 EXPECT_EQ(num_video_input_devices, notification_all_video_input.size());
575 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size()); 576 EXPECT_EQ(num_audio_output_devices, notification_all_audio_output.size());
576 } 577 }
577 578
578 } // namespace content 579 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698