| 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/audio_input_renderer_host.h" | 5 #include "content/browser/renderer_host/media/audio_input_renderer_host.h" |
| 6 | 6 |
| 7 #include <utility> |
| 7 #include <vector> | 8 #include <vector> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 11 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 12 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
| 13 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "content/browser/bad_message.h" | 15 #include "content/browser/bad_message.h" |
| 15 #include "content/browser/media/capture/audio_mirroring_manager.h" | 16 #include "content/browser/media/capture/audio_mirroring_manager.h" |
| 16 #include "content/browser/renderer_host/media/audio_input_device_manager.h" | 17 #include "content/browser/renderer_host/media/audio_input_device_manager.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 45 namespace content { | 46 namespace content { |
| 46 | 47 |
| 47 namespace { | 48 namespace { |
| 48 | 49 |
| 49 const int kStreamId = 100; | 50 const int kStreamId = 100; |
| 50 const int kRenderProcessId = 42; | 51 const int kRenderProcessId = 42; |
| 51 const int kRendererPid = 21718; | 52 const int kRendererPid = 21718; |
| 52 const int kRenderFrameId = 31415; | 53 const int kRenderFrameId = 31415; |
| 53 const int kSharedMemoryCount = 11; | 54 const int kSharedMemoryCount = 11; |
| 54 const char kSecurityOrigin[] = "http://localhost"; | 55 const char kSecurityOrigin[] = "http://localhost"; |
| 56 #if BUILDFLAG(ENABLE_WEBRTC) |
| 55 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
| 56 const wchar_t kBaseFileName[] = L"some_file_name"; | 58 const wchar_t kBaseFileName[] = L"some_file_name"; |
| 57 #else | 59 #else |
| 58 const char kBaseFileName[] = "some_file_name"; | 60 const char kBaseFileName[] = "some_file_name"; |
| 59 #endif | 61 #endif |
| 62 #endif // BUILDFLAG(ENABLE_WEBRTC) |
| 60 | 63 |
| 61 url::Origin SecurityOrigin() { | 64 url::Origin SecurityOrigin() { |
| 62 return url::Origin(GURL(kSecurityOrigin)); | 65 return url::Origin(GURL(kSecurityOrigin)); |
| 63 } | 66 } |
| 64 | 67 |
| 65 AudioInputHostMsg_CreateStream_Config DefaultConfig() { | 68 AudioInputHostMsg_CreateStream_Config DefaultConfig() { |
| 66 AudioInputHostMsg_CreateStream_Config config; | 69 AudioInputHostMsg_CreateStream_Config config; |
| 67 config.params = media::AudioParameters::UnavailableDeviceParams(); | 70 config.params = media::AudioParameters::UnavailableDeviceParams(); |
| 68 config.automatic_gain_control = false; | 71 config.automatic_gain_control = false; |
| 69 config.shared_memory_count = kSharedMemoryCount; | 72 config.shared_memory_count = kSharedMemoryCount; |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 EXPECT_CALL(controller_factory_, ControllerCreated()); | 567 EXPECT_CALL(controller_factory_, ControllerCreated()); |
| 565 | 568 |
| 566 airh_->OnMessageReceived(AudioInputHostMsg_CreateStream( | 569 airh_->OnMessageReceived(AudioInputHostMsg_CreateStream( |
| 567 kStreamId, kRenderFrameId, session_id, DefaultConfig())); | 570 kStreamId, kRenderFrameId, session_id, DefaultConfig())); |
| 568 base::RunLoop().RunUntilIdle(); | 571 base::RunLoop().RunUntilIdle(); |
| 569 | 572 |
| 570 EXPECT_CALL(*controller_factory_.controller(0), Close(_)); | 573 EXPECT_CALL(*controller_factory_.controller(0), Close(_)); |
| 571 } | 574 } |
| 572 | 575 |
| 573 } // namespace content | 576 } // namespace content |
| OLD | NEW |