summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 00:01:19 +0000
committernfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 00:01:19 +0000
commit10f0ec5bda8cd2170cf76c47a0e207c5d3cd8cbc (patch)
tree8627acdf7e7e2665aa93cabc84e6917c33b7ec93
parent9d2db766194046d9a60e6e9e18376f678c2ae1d4 (diff)
downloadchromium_src-10f0ec5bda8cd2170cf76c47a0e207c5d3cd8cbc.zip
chromium_src-10f0ec5bda8cd2170cf76c47a0e207c5d3cd8cbc.tar.gz
chromium_src-10f0ec5bda8cd2170cf76c47a0e207c5d3cd8cbc.tar.bz2
Add RecommendSampleRate() to audio config test.
BUG=none TEST=this is the test Review URL: https://chromiumcodereview.appspot.com/10534152 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142867 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/test/ui/ppapi_uitest.cc2
-rw-r--r--ppapi/tests/test_audio_config.cc12
-rw-r--r--ppapi/tests/test_audio_config.h1
3 files changed, 15 insertions, 0 deletions
diff --git a/chrome/test/ui/ppapi_uitest.cc b/chrome/test/ui/ppapi_uitest.cc
index 10e46d2..7476466 100644
--- a/chrome/test/ui/ppapi_uitest.cc
+++ b/chrome/test/ui/ppapi_uitest.cc
@@ -1017,8 +1017,10 @@ TEST_PPAPI_NACL_VIA_HTTP_WITH_WS(WebSocket_UtilityTextSendReceive)
TEST_PPAPI_NACL_VIA_HTTP_WITH_WS(WebSocket_UtilityBinarySendReceive)
TEST_PPAPI_NACL_VIA_HTTP_WITH_WS(WebSocket_UtilityBufferedAmount)
+TEST_PPAPI_IN_PROCESS(AudioConfig_RecommendSampleRate)
TEST_PPAPI_IN_PROCESS(AudioConfig_ValidConfigs)
TEST_PPAPI_IN_PROCESS(AudioConfig_InvalidConfigs)
+TEST_PPAPI_OUT_OF_PROCESS(AudioConfig_RecommendSampleRate)
TEST_PPAPI_OUT_OF_PROCESS(AudioConfig_ValidConfigs)
TEST_PPAPI_OUT_OF_PROCESS(AudioConfig_InvalidConfigs)
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();