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

Unified Diff: content/renderer/media/webrtc_audio_device_unittest.cc

Issue 8575002: Avoid checking the hardware from the Construct test for better bot compatibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc_audio_device_unittest.cc
===================================================================
--- content/renderer/media/webrtc_audio_device_unittest.cc (revision 110074)
+++ content/renderer/media/webrtc_audio_device_unittest.cc (working copy)
@@ -26,14 +26,37 @@
class AudioUtil : public AudioUtilInterface {
public:
+ AudioUtil() {}
+
virtual double GetAudioHardwareSampleRate() OVERRIDE {
return media::GetAudioHardwareSampleRate();
}
virtual double GetAudioInputHardwareSampleRate() OVERRIDE {
return media::GetAudioInputHardwareSampleRate();
}
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AudioUtil);
};
+class AudioUtilNoHardware : public AudioUtilInterface {
+ public:
+ AudioUtilNoHardware(double output_rate, double input_rate)
+ : output_rate_(output_rate), input_rate_(input_rate) {
henrika (OOO until Aug 14) 2011/11/16 09:57:58 add two more spaces?
+ }
+
+ virtual double GetAudioHardwareSampleRate() OVERRIDE {
+ return output_rate_;
+ }
+ virtual double GetAudioInputHardwareSampleRate() OVERRIDE {
+ return input_rate_;
+ }
+
+ private:
+ double output_rate_;
+ double input_rate_;
+ DISALLOW_COPY_AND_ASSIGN(AudioUtilNoHardware);
+};
+
bool IsRunningHeadless() {
scoped_ptr<base::Environment> env(base::Environment::Create());
if (env->HasVar("CHROME_HEADLESS"))
@@ -46,7 +69,7 @@
// Basic test that instantiates and initializes an instance of
// WebRtcAudioDeviceImpl.
TEST_F(WebRTCAudioDeviceTest, Construct) {
- AudioUtil audio_util;
+ AudioUtilNoHardware audio_util(48000.0, 48000.0);
set_audio_util_callback(&audio_util);
scoped_refptr<WebRtcAudioDeviceImpl> audio_device(
new WebRtcAudioDeviceImpl());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698