Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Unified Diff: media/audio/android/audio_android_unittest.cc

Issue 2379303003: media: Delete code checking for pre-JellyBean Android versions (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/media/media_source_browsertest.cc ('k') | media/audio/android/audio_manager_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/android/audio_android_unittest.cc
diff --git a/media/audio/android/audio_android_unittest.cc b/media/audio/android/audio_android_unittest.cc
index 70e2e9c465bf9fe72a1395696b5c97067b681666..b883d13afe799d615c3fb2142d47155740183a97 100644
--- a/media/audio/android/audio_android_unittest.cc
+++ b/media/audio/android/audio_android_unittest.cc
@@ -585,16 +585,6 @@ class AudioAndroidOutputTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(AudioAndroidOutputTest);
};
-// AudioRecordInputStream should only be created on Jelly Bean and higher. This
-// ensures we only test against the AudioRecord path when that is satisfied.
-std::vector<bool> RunAudioRecordInputPathTests() {
- std::vector<bool> tests;
- tests.push_back(false);
- if (base::android::BuildInfo::GetInstance()->sdk_int() >= 16)
- tests.push_back(true);
- return tests;
-}
-
// Test fixture class for tests which exercise the input path, or both input and
// output paths. It is value-parameterized to test against both the Java
// AudioRecord (when true) and native OpenSLES (when false) input paths.
@@ -612,8 +602,9 @@ class AudioAndroidInputTest : public AudioAndroidOutputTest,
GetDefaultInputStreamParametersOnAudioThread();
AudioParameters params = audio_input_parameters();
- // Override the platform effects setting to use the AudioRecord or OpenSLES
- // path as requested.
+
+ // Only the AudioRecord path supports effects, so we can force it to be
+ // selected for the test by requesting one. OpenSLES is used otherwise.
params.set_effects(GetParam() ? AudioParameters::ECHO_CANCELLER
: AudioParameters::NO_EFFECTS);
return params;
@@ -976,7 +967,8 @@ TEST_P(AudioAndroidInputTest,
StopAndCloseAudioInputStreamOnAudioThread();
}
-INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest, AudioAndroidInputTest,
- testing::ValuesIn(RunAudioRecordInputPathTests()));
+INSTANTIATE_TEST_CASE_P(AudioAndroidInputTest,
+ AudioAndroidInputTest,
+ testing::Bool());
liberato (no reviews please) 2016/10/03 15:43:23 that's neat.
} // namespace media
« no previous file with comments | « content/browser/media/media_source_browsertest.cc ('k') | media/audio/android/audio_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698