| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "media/audio/audio_io.h" | 10 #include "media/audio/audio_io.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 TEST_F(AUHALStreamTest, CreateOpenStartStopClose) { | 87 TEST_F(AUHALStreamTest, CreateOpenStartStopClose) { |
| 88 if (!CanRunAudioTests()) | 88 if (!CanRunAudioTests()) |
| 89 return; | 89 return; |
| 90 | 90 |
| 91 AudioOutputStream* stream = Create(); | 91 AudioOutputStream* stream = Create(); |
| 92 EXPECT_TRUE(stream->Open()); | 92 EXPECT_TRUE(stream->Open()); |
| 93 | 93 |
| 94 // Wait for the first data callback from the OS. | 94 // Wait for the first data callback from the OS. |
| 95 base::WaitableEvent event(false, false); | 95 base::WaitableEvent event(false, false); |
| 96 EXPECT_CALL(source_, OnMoreIOData(_, _, _)) | 96 EXPECT_CALL(source_, OnMoreData(_, _)) |
| 97 .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0))); | 97 .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0))); |
| 98 EXPECT_CALL(source_, OnError(_)).Times(0); | 98 EXPECT_CALL(source_, OnError(_)).Times(0); |
| 99 stream->Start(&source_); | 99 stream->Start(&source_); |
| 100 event.Wait(); | 100 event.Wait(); |
| 101 | 101 |
| 102 stream->Stop(); | 102 stream->Stop(); |
| 103 stream->Close(); | 103 stream->Close(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 } // namespace media | 106 } // namespace media |
| OLD | NEW |