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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "media/audio/audio_input_controller.h" | 10 #include "media/audio/audio_input_controller.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 // Record and wait until ten OnData() callbacks are received. | 138 // Record and wait until ten OnData() callbacks are received. |
139 message_loop_.Run(); | 139 message_loop_.Run(); |
140 | 140 |
141 // Close the AudioInputController synchronously. | 141 // Close the AudioInputController synchronously. |
142 CloseAudioController(controller.get()); | 142 CloseAudioController(controller.get()); |
143 } | 143 } |
144 | 144 |
145 // Test that the AudioInputController reports an error when the input stream | 145 // Test that the AudioInputController reports an error when the input stream |
146 // stops. This can happen when the underlying audio layer stops feeding data as | 146 // stops. This can happen when the underlying audio layer stops feeding data as |
147 // a result of a removed microphone device. | 147 // a result of a removed microphone device. |
148 #if defined(OS_MACOSX) | 148 // Disabled due to crbug.com/357569 |
tommi (sloooow) - chröme
2014/03/31 11:11:52
and crbug.com/357501?
| |
149 // Disabled on Mac due to crbug.com/357501. | 149 // TODO(henrika): Remove the test when the timer workaround has been removed. |
150 // TODO(tommi): Remove the test when the timer workaround has been removed. | 150 TEST_F(AudioInputControllerTest, DISABLED_RecordAndError) { |
151 #define MAYBE_RecordAndError DISABLED_RecordAndError | |
152 #else | |
153 #define MAYBE_RecordAndError RecordAndError | |
154 #endif | |
155 TEST_F(AudioInputControllerTest, MAYBE_RecordAndError) { | |
156 MockAudioInputControllerEventHandler event_handler; | 151 MockAudioInputControllerEventHandler event_handler; |
157 int count = 0; | 152 int count = 0; |
158 | 153 |
159 // OnCreated() will be called once. | 154 // OnCreated() will be called once. |
160 EXPECT_CALL(event_handler, OnCreated(NotNull())) | 155 EXPECT_CALL(event_handler, OnCreated(NotNull())) |
161 .Times(Exactly(1)); | 156 .Times(Exactly(1)); |
162 | 157 |
163 // OnRecording() will be called only once. | 158 // OnRecording() will be called only once. |
164 EXPECT_CALL(event_handler, OnRecording(NotNull())) | 159 EXPECT_CALL(event_handler, OnRecording(NotNull())) |
165 .Times(Exactly(1)); | 160 .Times(Exactly(1)); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 controller->Record(); | 252 controller->Record(); |
258 | 253 |
259 controller->Close(base::MessageLoop::QuitClosure()); | 254 controller->Close(base::MessageLoop::QuitClosure()); |
260 base::MessageLoop::current()->Run(); | 255 base::MessageLoop::current()->Run(); |
261 | 256 |
262 controller->Close(base::MessageLoop::QuitClosure()); | 257 controller->Close(base::MessageLoop::QuitClosure()); |
263 base::MessageLoop::current()->Run(); | 258 base::MessageLoop::current()->Run(); |
264 } | 259 } |
265 | 260 |
266 } // namespace media | 261 } // namespace media |
OLD | NEW |