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

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

Issue 2578983003: Add AudioStreamRegistry. Move stream counting logic (Closed)
Patch Set: Thread checks. Created 3 years, 11 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698