| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 } | 81 } |
| 82 | 82 |
| 83 TEST_F(AUHALStreamTest, CreateOpenStartStopClose) { | 83 TEST_F(AUHALStreamTest, CreateOpenStartStopClose) { |
| 84 ABORT_AUDIO_TEST_IF_NOT(OutputDevicesAvailable()); | 84 ABORT_AUDIO_TEST_IF_NOT(OutputDevicesAvailable()); |
| 85 | 85 |
| 86 AudioOutputStream* stream = Create(); | 86 AudioOutputStream* stream = Create(); |
| 87 EXPECT_TRUE(stream->Open()); | 87 EXPECT_TRUE(stream->Open()); |
| 88 | 88 |
| 89 // Wait for the first data callback from the OS. | 89 // Wait for the first data callback from the OS. |
| 90 base::WaitableEvent event(false, false); | 90 base::WaitableEvent event(false, false); |
| 91 EXPECT_CALL(source_, OnMoreData(_, _)) | 91 EXPECT_CALL(source_, OnMoreData(_, _, _)) |
| 92 .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0))); | 92 .WillOnce(DoAll(ZeroBuffer(), SignalEvent(&event), Return(0))); |
| 93 EXPECT_CALL(source_, OnError(_)).Times(0); | 93 EXPECT_CALL(source_, OnError(_)).Times(0); |
| 94 stream->Start(&source_); | 94 stream->Start(&source_); |
| 95 event.Wait(); | 95 event.Wait(); |
| 96 | 96 |
| 97 stream->Stop(); | 97 stream->Stop(); |
| 98 stream->Close(); | 98 stream->Close(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 } // namespace media | 101 } // namespace media |
| OLD | NEW |