OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/process/process_handle.h" | 10 #include "base/process/process_handle.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 117 |
118 const bool synchronized_io_; | 118 const bool synchronized_io_; |
119 const int input_channels_; | 119 const int input_channels_; |
120 SharedMemory shared_memory_; | 120 SharedMemory shared_memory_; |
121 CancelableSyncSocket browser_socket_; | 121 CancelableSyncSocket browser_socket_; |
122 CancelableSyncSocket renderer_socket_; | 122 CancelableSyncSocket renderer_socket_; |
123 | 123 |
124 DISALLOW_COPY_AND_ASSIGN(AudioOutputDeviceTest); | 124 DISALLOW_COPY_AND_ASSIGN(AudioOutputDeviceTest); |
125 }; | 125 }; |
126 | 126 |
127 static const int kStreamId = 123; | |
128 | |
129 int AudioOutputDeviceTest::CalculateMemorySize() { | 127 int AudioOutputDeviceTest::CalculateMemorySize() { |
130 // Calculate output and input memory size. | 128 // Calculate output and input memory size. |
131 int output_memory_size = | 129 int output_memory_size = |
132 AudioBus::CalculateMemorySize(default_audio_parameters_); | 130 AudioBus::CalculateMemorySize(default_audio_parameters_); |
133 | 131 |
134 int frames = default_audio_parameters_.frames_per_buffer(); | 132 int frames = default_audio_parameters_.frames_per_buffer(); |
135 int input_memory_size = | 133 int input_memory_size = |
136 AudioBus::CalculateMemorySize(input_channels_, frames); | 134 AudioBus::CalculateMemorySize(input_channels_, frames); |
137 | 135 |
138 int io_buffer_size = output_memory_size + input_memory_size; | 136 int io_buffer_size = output_memory_size + input_memory_size; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 ExpectRenderCallback(); | 283 ExpectRenderCallback(); |
286 CreateStream(); | 284 CreateStream(); |
287 WaitUntilRenderCallback(); | 285 WaitUntilRenderCallback(); |
288 StopAudioDevice(); | 286 StopAudioDevice(); |
289 } | 287 } |
290 | 288 |
291 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); | 289 INSTANTIATE_TEST_CASE_P(Render, AudioOutputDeviceTest, Values(false)); |
292 INSTANTIATE_TEST_CASE_P(RenderIO, AudioOutputDeviceTest, Values(true)); | 290 INSTANTIATE_TEST_CASE_P(RenderIO, AudioOutputDeviceTest, Values(true)); |
293 | 291 |
294 } // namespace media. | 292 } // namespace media. |
OLD | NEW |