| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <mmsystem.h> | 6 #include <mmsystem.h> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/memory/aligned_memory.h" | 10 #include "base/memory/aligned_memory.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 using ::testing::DoAll; | 25 using ::testing::DoAll; |
| 26 using ::testing::Field; | 26 using ::testing::Field; |
| 27 using ::testing::Invoke; | 27 using ::testing::Invoke; |
| 28 using ::testing::InSequence; | 28 using ::testing::InSequence; |
| 29 using ::testing::NiceMock; | 29 using ::testing::NiceMock; |
| 30 using ::testing::NotNull; | 30 using ::testing::NotNull; |
| 31 using ::testing::Return; | 31 using ::testing::Return; |
| 32 | 32 |
| 33 namespace media { | 33 namespace media { |
| 34 | 34 |
| 35 static const wchar_t kAudioFile1_16b_m_16K[] | |
| 36 = L"media\\test\\data\\sweep02_16b_mono_16KHz.raw"; | |
| 37 | |
| 38 static int ClearData(AudioBus* audio_bus, uint32 total_bytes_delay) { | 35 static int ClearData(AudioBus* audio_bus, uint32 total_bytes_delay) { |
| 39 audio_bus->Zero(); | 36 audio_bus->Zero(); |
| 40 return audio_bus->frames(); | 37 return audio_bus->frames(); |
| 41 } | 38 } |
| 42 | 39 |
| 43 // This class allows to find out if the callbacks are occurring as | 40 // This class allows to find out if the callbacks are occurring as |
| 44 // expected and if any error has been reported. | 41 // expected and if any error has been reported. |
| 45 class TestSourceBasic : public AudioOutputStream::AudioSourceCallback { | 42 class TestSourceBasic : public AudioOutputStream::AudioSourceCallback { |
| 46 public: | 43 public: |
| 47 explicit TestSourceBasic() | 44 explicit TestSourceBasic() |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 oas->Start(&source); | 617 oas->Start(&source); |
| 621 | 618 |
| 622 ::WaitForSingleObject(thread, INFINITE); | 619 ::WaitForSingleObject(thread, INFINITE); |
| 623 ::CloseHandle(thread); | 620 ::CloseHandle(thread); |
| 624 | 621 |
| 625 oas->Stop(); | 622 oas->Stop(); |
| 626 oas->Close(); | 623 oas->Close(); |
| 627 } | 624 } |
| 628 | 625 |
| 629 } // namespace media | 626 } // namespace media |
| OLD | NEW |