diff options
Diffstat (limited to 'ppapi/tests')
-rw-r--r-- | ppapi/tests/test_audio_config.cc | 12 | ||||
-rw-r--r-- | ppapi/tests/test_audio_config.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/ppapi/tests/test_audio_config.cc b/ppapi/tests/test_audio_config.cc index 902fc61..c41ea3f 100644 --- a/ppapi/tests/test_audio_config.cc +++ b/ppapi/tests/test_audio_config.cc @@ -19,10 +19,22 @@ bool TestAudioConfig::Init() { } void TestAudioConfig::RunTests(const std::string& filter) { + RUN_TEST(RecommendSampleRate, filter); RUN_TEST(ValidConfigs, filter); RUN_TEST(InvalidConfigs, filter); } +std::string TestAudioConfig::TestRecommendSampleRate() { + // Ask PPB_AudioConfig about the recommended sample rate. + PP_AudioSampleRate sample_rate = audio_config_interface_->RecommendSampleRate( + instance_->pp_instance()); + ASSERT_TRUE(sample_rate == PP_AUDIOSAMPLERATE_NONE || + sample_rate == PP_AUDIOSAMPLERATE_44100 || + sample_rate == PP_AUDIOSAMPLERATE_48000); + + PASS(); +} + std::string TestAudioConfig::TestValidConfigs() { static const PP_AudioSampleRate kSampleRates[] = { PP_AUDIOSAMPLERATE_44100, diff --git a/ppapi/tests/test_audio_config.h b/ppapi/tests/test_audio_config.h index 71a1ae6..55abc67 100644 --- a/ppapi/tests/test_audio_config.h +++ b/ppapi/tests/test_audio_config.h @@ -20,6 +20,7 @@ class TestAudioConfig : public TestCase { virtual void RunTests(const std::string& filter); private: + std::string TestRecommendSampleRate(); std::string TestValidConfigs(); std::string TestInvalidConfigs(); |