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 "ppapi/tests/test_audio.h" | 5 #include "ppapi/tests/test_audio.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "ppapi/c/ppb_audio_config.h" | 9 #include "ppapi/c/ppb_audio_config.h" |
10 #include "ppapi/c/ppb_audio.h" | 10 #include "ppapi/c/ppb_audio.h" |
11 #include "ppapi/cpp/module.h" | 11 #include "ppapi/cpp/module.h" |
12 #include "ppapi/tests/testing_instance.h" | 12 #include "ppapi/tests/testing_instance.h" |
13 #include "ppapi/tests/test_utils.h" | 13 #include "ppapi/tests/test_utils.h" |
14 | 14 |
15 #define ARRAYSIZE_UNSAFE(a) \ | 15 #define ARRAYSIZE_UNSAFE(a) \ |
16 ((sizeof(a) / sizeof(*(a))) / \ | 16 ((sizeof(a) / sizeof(*(a))) / \ |
17 static_cast<size_t>(!(sizeof(a) % sizeof(*(a))))) | 17 static_cast<size_t>(!(sizeof(a) % sizeof(*(a))))) |
18 | 18 |
19 REGISTER_TEST_CASE(Audio); | 19 REGISTER_TEST_CASE(Audio); |
20 | 20 |
21 const int32_t kMagicValue = 12345; | |
22 | |
23 TestAudio::TestAudio(TestingInstance* instance) | 21 TestAudio::TestAudio(TestingInstance* instance) |
24 : TestCase(instance), | 22 : TestCase(instance), |
25 audio_callback_method_(NULL), | 23 audio_callback_method_(NULL), |
26 audio_callback_event_(instance->pp_instance()), | 24 audio_callback_event_(instance->pp_instance()), |
27 test_done_(false), | 25 test_done_(false), |
28 audio_interface_(NULL), | 26 audio_interface_(NULL), |
29 audio_interface_1_0_(NULL), | 27 audio_interface_1_0_(NULL), |
30 audio_config_interface_(NULL), | 28 audio_config_interface_(NULL), |
31 core_interface_(NULL) { | 29 core_interface_(NULL) { |
32 } | 30 } |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 367 } |
370 | 368 |
371 PP_Resource TestAudio::CreateAudioConfig( | 369 PP_Resource TestAudio::CreateAudioConfig( |
372 PP_AudioSampleRate sample_rate, | 370 PP_AudioSampleRate sample_rate, |
373 uint32_t requested_sample_frame_count) { | 371 uint32_t requested_sample_frame_count) { |
374 uint32_t frame_count = audio_config_interface_->RecommendSampleFrameCount( | 372 uint32_t frame_count = audio_config_interface_->RecommendSampleFrameCount( |
375 instance_->pp_instance(), sample_rate, requested_sample_frame_count); | 373 instance_->pp_instance(), sample_rate, requested_sample_frame_count); |
376 return audio_config_interface_->CreateStereo16Bit( | 374 return audio_config_interface_->CreateStereo16Bit( |
377 instance_->pp_instance(), sample_rate, frame_count); | 375 instance_->pp_instance(), sample_rate, frame_count); |
378 } | 376 } |
OLD | NEW |