OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
| 7 #include <memory> |
7 #include <string> | 8 #include <string> |
8 | 9 |
9 #include "base/macros.h" | 10 #include "base/macros.h" |
10 #include "base/run_loop.h" | 11 #include "base/run_loop.h" |
11 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
12 #include "base/test/test_message_loop.h" | 13 #include "base/test/test_message_loop.h" |
13 #include "base/test/test_timeouts.h" | 14 #include "base/test/test_timeouts.h" |
14 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
15 #include "base/time/time.h" | 16 #include "base/time/time.h" |
16 #include "media/audio/cras/audio_manager_cras.h" | 17 #include "media/audio/cras/audio_manager_cras.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 return *(mock_manager_.get()); | 92 return *(mock_manager_.get()); |
92 } | 93 } |
93 | 94 |
94 static const ChannelLayout kTestChannelLayout; | 95 static const ChannelLayout kTestChannelLayout; |
95 static const int kTestSampleRate; | 96 static const int kTestSampleRate; |
96 static const int kTestBitsPerSample; | 97 static const int kTestBitsPerSample; |
97 static const AudioParameters::Format kTestFormat; | 98 static const AudioParameters::Format kTestFormat; |
98 static const uint32_t kTestFramesPerPacket; | 99 static const uint32_t kTestFramesPerPacket; |
99 | 100 |
100 base::TestMessageLoop message_loop_; | 101 base::TestMessageLoop message_loop_; |
101 scoped_ptr<StrictMock<MockAudioManagerCras>, AudioManagerDeleter> | 102 std::unique_ptr<StrictMock<MockAudioManagerCras>, AudioManagerDeleter> |
102 mock_manager_; | 103 mock_manager_; |
103 | 104 |
104 private: | 105 private: |
105 DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStreamTest); | 106 DISALLOW_COPY_AND_ASSIGN(CrasUnifiedStreamTest); |
106 }; | 107 }; |
107 | 108 |
108 const ChannelLayout CrasUnifiedStreamTest::kTestChannelLayout = | 109 const ChannelLayout CrasUnifiedStreamTest::kTestChannelLayout = |
109 CHANNEL_LAYOUT_STEREO; | 110 CHANNEL_LAYOUT_STEREO; |
110 const int CrasUnifiedStreamTest::kTestSampleRate = | 111 const int CrasUnifiedStreamTest::kTestSampleRate = |
111 AudioParameters::kAudioCDSampleRate; | 112 AudioParameters::kAudioCDSampleRate; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 163 |
163 // Wait for samples to be captured. | 164 // Wait for samples to be captured. |
164 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout())); | 165 EXPECT_TRUE(event.TimedWait(TestTimeouts::action_timeout())); |
165 | 166 |
166 test_stream->Stop(); | 167 test_stream->Stop(); |
167 | 168 |
168 test_stream->Close(); | 169 test_stream->Close(); |
169 } | 170 } |
170 | 171 |
171 } // namespace media | 172 } // namespace media |
OLD | NEW |