| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( | 255 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( |
| 256 AudioParameters(fmt, CHANNEL_LAYOUT_UNSUPPORTED, 8000, 16, 256))); | 256 AudioParameters(fmt, CHANNEL_LAYOUT_UNSUPPORTED, 8000, 16, 256))); |
| 257 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( | 257 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( |
| 258 AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, -8000, 16, 256))); | 258 AudioParameters(fmt, CHANNEL_LAYOUT_STEREO, -8000, 16, 256))); |
| 259 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( | 259 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( |
| 260 AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, -100))); | 260 AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, -100))); |
| 261 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( | 261 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( |
| 262 AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, 0))); | 262 AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, 0))); |
| 263 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( | 263 EXPECT_TRUE(NULL == audio_man->MakeAudioOutputStream( |
| 264 AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, | 264 AudioParameters(fmt, CHANNEL_LAYOUT_MONO, 8000, 16, |
| 265 media::Limits::kMaxSamplesPerPacket + 1))); | 265 media::limits::kMaxSamplesPerPacket + 1))); |
| 266 } | 266 } |
| 267 | 267 |
| 268 // Test that it can be opened and closed. | 268 // Test that it can be opened and closed. |
| 269 TEST(WinAudioTest, PCMWaveStreamOpenAndClose) { | 269 TEST(WinAudioTest, PCMWaveStreamOpenAndClose) { |
| 270 if (IsRunningHeadless()) | 270 if (IsRunningHeadless()) |
| 271 return; | 271 return; |
| 272 AudioManager* audio_man = AudioManager::GetAudioManager(); | 272 AudioManager* audio_man = AudioManager::GetAudioManager(); |
| 273 ASSERT_TRUE(NULL != audio_man); | 273 ASSERT_TRUE(NULL != audio_man); |
| 274 if (!audio_man->HasAudioOutputDevices()) | 274 if (!audio_man->HasAudioOutputDevices()) |
| 275 return; | 275 return; |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 | 743 |
| 744 oas->Start(&source); | 744 oas->Start(&source); |
| 745 | 745 |
| 746 ::WaitForSingleObject(thread, INFINITE); | 746 ::WaitForSingleObject(thread, INFINITE); |
| 747 ::CloseHandle(thread); | 747 ::CloseHandle(thread); |
| 748 delete sockets[1]; | 748 delete sockets[1]; |
| 749 | 749 |
| 750 oas->Stop(); | 750 oas->Stop(); |
| 751 oas->Close(); | 751 oas->Close(); |
| 752 } | 752 } |
| OLD | NEW |