| 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 #ifndef PAPPI_TESTS_TEST_AUDIO_H_ | 5 #ifndef PAPPI_TESTS_TEST_AUDIO_H_ |
| 6 #define PAPPI_TESTS_TEST_AUDIO_H_ | 6 #define PAPPI_TESTS_TEST_AUDIO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ppapi/c/ppb_audio.h" | 10 #include "ppapi/c/ppb_audio.h" |
| 11 #include "ppapi/c/ppb_audio_config.h" | 11 #include "ppapi/c/ppb_audio_config.h" |
| 12 #include "ppapi/c/ppb_core.h" | 12 #include "ppapi/c/ppb_core.h" |
| 13 #include "ppapi/tests/test_case.h" | 13 #include "ppapi/tests/test_case.h" |
| 14 | 14 |
| 15 class TestAudio : public TestCase { | 15 class TestAudio : public TestCase { |
| 16 public: | 16 public: |
| 17 explicit TestAudio(TestingInstance* instance); | 17 explicit TestAudio(TestingInstance* instance); |
| 18 ~TestAudio(); | 18 ~TestAudio(); |
| 19 | 19 |
| 20 // TestCase implementation. | 20 // TestCase implementation. |
| 21 virtual bool Init(); | 21 virtual bool Init(); |
| 22 virtual void RunTests(const std::string& filter); | 22 virtual void RunTests(const std::string& filter); |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 std::string TestCreation(); | 25 std::string TestCreation(); |
| 26 std::string TestDestroyNoStop(); | 26 std::string TestDestroyNoStop(); |
| 27 std::string TestFailures(); | 27 std::string TestFailures(); |
| 28 std::string TestAudioCallback1(); | 28 std::string TestAudioCallback1(); |
| 29 std::string TestAudioCallback2(); | 29 std::string TestAudioCallback2(); |
| 30 std::string TestAudioCallback3(); |
| 30 | 31 |
| 31 // Calls |audio_callback_method_| (where |user_data| is "this"). | 32 // Calls |audio_callback_method_| (where |user_data| is "this"). |
| 32 static void AudioCallbackTrampoline(void* sample_buffer, | 33 static void AudioCallbackTrampoline(void* sample_buffer, |
| 33 uint32_t buffer_size_in_bytes, | 34 uint32_t buffer_size_in_bytes, |
| 34 void* user_data); | 35 void* user_data); |
| 35 | 36 |
| 36 typedef void (TestAudio::*AudioCallbackMethod)(void* sample_buffer, | 37 typedef void (TestAudio::*AudioCallbackMethod)(void* sample_buffer, |
| 37 uint32_t buffer_size_in_bytes); | 38 uint32_t buffer_size_in_bytes); |
| 38 | 39 |
| 39 // Method called by |AudioCallbackTrampoline()|. Set only when the callback | 40 // Method called by |AudioCallbackTrampoline()|. Set only when the callback |
| (...skipping 13 matching lines...) Expand all Loading... |
| 53 bool test_done_; | 54 bool test_done_; |
| 54 bool callback_fired_; | 55 bool callback_fired_; |
| 55 | 56 |
| 56 // Raw C-level interfaces, set in |Init()|; do not modify them elsewhere. | 57 // Raw C-level interfaces, set in |Init()|; do not modify them elsewhere. |
| 57 const PPB_Audio* audio_interface_; | 58 const PPB_Audio* audio_interface_; |
| 58 const PPB_AudioConfig* audio_config_interface_; | 59 const PPB_AudioConfig* audio_config_interface_; |
| 59 const PPB_Core* core_interface_; | 60 const PPB_Core* core_interface_; |
| 60 }; | 61 }; |
| 61 | 62 |
| 62 #endif // PAPPI_TESTS_TEST_AUDIO_H_ | 63 #endif // PAPPI_TESTS_TEST_AUDIO_H_ |
| OLD | NEW |