| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_encoder.h" | 5 #include "ppapi/tests/test_audio_encoder.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_codecs.h" | 7 #include "ppapi/c/pp_codecs.h" |
| 8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
| 9 #include "ppapi/cpp/audio_encoder.h" | 9 #include "ppapi/cpp/audio_encoder.h" |
| 10 #include "ppapi/tests/testing_instance.h" | 10 #include "ppapi/tests/testing_instance.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 RUN_CALLBACK_TEST(TestAudioEncoder, InitializeOpusMono, filter); | 24 RUN_CALLBACK_TEST(TestAudioEncoder, InitializeOpusMono, filter); |
| 25 RUN_CALLBACK_TEST(TestAudioEncoder, InitializeOpusStereo, filter); | 25 RUN_CALLBACK_TEST(TestAudioEncoder, InitializeOpusStereo, filter); |
| 26 } | 26 } |
| 27 | 27 |
| 28 std::string TestAudioEncoder::TestAvailableCodecs() { | 28 std::string TestAudioEncoder::TestAvailableCodecs() { |
| 29 // Test that we get results for supported formats. We should at | 29 // Test that we get results for supported formats. We should at |
| 30 // least get the software supported formats. | 30 // least get the software supported formats. |
| 31 pp::AudioEncoder audio_encoder(instance_); | 31 pp::AudioEncoder audio_encoder(instance_); |
| 32 ASSERT_FALSE(audio_encoder.is_null()); | 32 ASSERT_FALSE(audio_encoder.is_null()); |
| 33 | 33 |
| 34 TestCompletionCallbackWithOutput<std::vector<PP_AudioProfileDescription>> | 34 TestCompletionCallbackWithOutput<std::vector<PP_AudioProfileDescription> > |
| 35 callback(instance_->pp_instance(), false); | 35 callback(instance_->pp_instance(), false); |
| 36 callback.WaitForResult( | 36 callback.WaitForResult( |
| 37 audio_encoder.GetSupportedProfiles(callback.GetCallback())); | 37 audio_encoder.GetSupportedProfiles(callback.GetCallback())); |
| 38 ASSERT_GE(callback.result(), 1U); | 38 ASSERT_GE(callback.result(), 1U); |
| 39 | 39 |
| 40 const std::vector<PP_AudioProfileDescription> audio_profiles = | 40 const std::vector<PP_AudioProfileDescription> audio_profiles = |
| 41 callback.output(); | 41 callback.output(); |
| 42 ASSERT_GE(audio_profiles.size(), 1U); | 42 ASSERT_GE(audio_profiles.size(), 1U); |
| 43 | 43 |
| 44 bool found_opus_48hz = false; | 44 bool found_opus_48hz = false; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 ASSERT_GE(audio_encoder.GetNumberOfSamples(), 2U); | 135 ASSERT_GE(audio_encoder.GetNumberOfSamples(), 2U); |
| 136 | 136 |
| 137 TestCompletionCallbackWithOutput<pp::AudioBuffer> get_buffer( | 137 TestCompletionCallbackWithOutput<pp::AudioBuffer> get_buffer( |
| 138 instance_->pp_instance(), false); | 138 instance_->pp_instance(), false); |
| 139 get_buffer.WaitForResult(audio_encoder.GetBuffer(get_buffer.GetCallback())); | 139 get_buffer.WaitForResult(audio_encoder.GetBuffer(get_buffer.GetCallback())); |
| 140 ASSERT_EQ(PP_OK, get_buffer.result()); | 140 ASSERT_EQ(PP_OK, get_buffer.result()); |
| 141 | 141 |
| 142 PASS(); | 142 PASS(); |
| 143 } | 143 } |
| OLD | NEW |