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

Unified Diff: trunk/src/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc

Issue 300143005: Revert 272884 "reland 260073013: Added automatic mode to FakeInp..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 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
Index: trunk/src/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
===================================================================
--- trunk/src/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc (revision 272929)
+++ trunk/src/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc (working copy)
@@ -54,6 +54,11 @@
public:
MAYBE_AudioInputDeviceManagerTest() {}
+ // Returns true iff machine has an audio input device.
+ bool CanRunAudioInputDeviceTests() {
+ return audio_manager_->HasAudioInputDevices();
+ }
+
protected:
virtual void SetUp() OVERRIDE {
// The test must run on Browser::IO.
@@ -68,7 +73,6 @@
&base::WaitableEvent::Signal, base::Unretained(&event)));
event.Wait();
manager_ = new AudioInputDeviceManager(audio_manager_.get());
- manager_->UseFakeDevice();
audio_input_listener_.reset(new MockAudioInputDeviceManagerListener());
manager_->Register(audio_input_listener_.get(),
message_loop_->message_loop_proxy().get());
@@ -102,6 +106,8 @@
// Opens and closes the devices.
TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenAndCloseDevice) {
+ if (!CanRunAudioInputDeviceTests())
+ return;
ASSERT_FALSE(devices_.empty());
@@ -131,6 +137,9 @@
// Opens multiple devices at one time and closes them later.
TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenMultipleDevices) {
+ if (!CanRunAudioInputDeviceTests())
+ return;
+
ASSERT_FALSE(devices_.empty());
InSequence s;
@@ -174,6 +183,8 @@
// Opens a non-existing device.
TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenNotExistingDevice) {
+ if (!CanRunAudioInputDeviceTests())
+ return;
InSequence s;
MediaStreamType stream_type = MEDIA_DEVICE_AUDIO_CAPTURE;
@@ -195,6 +206,9 @@
// Opens default device twice.
TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenDeviceTwice) {
+ if (!CanRunAudioInputDeviceTests())
+ return;
+
ASSERT_FALSE(devices_.empty());
InSequence s;
@@ -228,6 +242,9 @@
// Accesses then closes the sessions after opening the devices.
TEST_F(MAYBE_AudioInputDeviceManagerTest, AccessAndCloseSession) {
+ if (!CanRunAudioInputDeviceTests())
+ return;
+
ASSERT_FALSE(devices_.empty());
InSequence s;
@@ -261,6 +278,8 @@
// Access an invalid session.
TEST_F(MAYBE_AudioInputDeviceManagerTest, AccessInvalidSession) {
+ if (!CanRunAudioInputDeviceTests())
+ return;
InSequence s;
// Opens the first device.

Powered by Google App Engine
This is Rietveld 408576698