OLD | NEW |
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_dispatcher_host.h" | 5 #include "content/browser/renderer_host/media/media_devices_dispatcher_host.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <queue> | 10 #include <queue> |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 // The order of these members is important on teardown: | 282 // The order of these members is important on teardown: |
283 // MediaDevicesDispatcherHost expects to be destroyed on the IO thread while | 283 // MediaDevicesDispatcherHost expects to be destroyed on the IO thread while |
284 // MediaStreamManager expects to be destroyed after the IO thread has been | 284 // MediaStreamManager expects to be destroyed after the IO thread has been |
285 // uninitialized. | 285 // uninitialized. |
286 std::unique_ptr<MediaStreamManager> media_stream_manager_; | 286 std::unique_ptr<MediaStreamManager> media_stream_manager_; |
287 content::TestBrowserThreadBundle thread_bundle_; | 287 content::TestBrowserThreadBundle thread_bundle_; |
288 std::unique_ptr<MediaDevicesDispatcherHost> host_; | 288 std::unique_ptr<MediaDevicesDispatcherHost> host_; |
289 | 289 |
290 std::unique_ptr<media::AudioManager, media::AudioManagerDeleter> | 290 std::unique_ptr<media::AudioManager, media::AudioManagerDeleter> |
291 audio_manager_; | 291 audio_manager_; |
292 std::unique_ptr<media::AudioSystem> audio_system_; | 292 media::AudioSystem::UniquePtr audio_system_; |
293 content::TestBrowserContext browser_context_; | 293 content::TestBrowserContext browser_context_; |
294 MediaDeviceEnumeration physical_devices_; | 294 MediaDeviceEnumeration physical_devices_; |
295 url::Origin origin_; | 295 url::Origin origin_; |
296 | 296 |
297 std::vector<MediaDeviceInfoArray> enumerated_devices_; | 297 std::vector<MediaDeviceInfoArray> enumerated_devices_; |
298 }; | 298 }; |
299 | 299 |
300 TEST_F(MediaDevicesDispatcherHostTest, EnumerateAudioInputDevices) { | 300 TEST_F(MediaDevicesDispatcherHostTest, EnumerateAudioInputDevices) { |
301 EnumerateDevicesAndWaitForResult(true, false, false); | 301 EnumerateDevicesAndWaitForResult(true, false, false); |
302 EXPECT_TRUE(DoesContainLabels(enumerated_devices_)); | 302 EXPECT_TRUE(DoesContainLabels(enumerated_devices_)); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 // On Windows, the underlying MediaStreamManager uses a separate thread for | 382 // On Windows, the underlying MediaStreamManager uses a separate thread for |
383 // video capture which must be flushed to guarantee that the callback bound to | 383 // video capture which must be flushed to guarantee that the callback bound to |
384 // GetVIdeoInputCapabilities above is invoked before the end of this test's | 384 // GetVIdeoInputCapabilities above is invoked before the end of this test's |
385 // body. | 385 // body. |
386 media_stream_manager_->FlushVideoCaptureThreadForTesting(); | 386 media_stream_manager_->FlushVideoCaptureThreadForTesting(); |
387 base::RunLoop().RunUntilIdle(); | 387 base::RunLoop().RunUntilIdle(); |
388 #endif | 388 #endif |
389 } | 389 } |
390 | 390 |
391 }; // namespace content | 391 }; // namespace content |
OLD | NEW |