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

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

Issue 260073013: Added automatic mode to FakeInputAudioStream to generate automatic beeps (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: consolidated how we inject fake audio devices. 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: content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
diff --git a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
index 4b9e80e21cd755679c8ae9813c9f68b144050571..c2963eefd362d3785e897d121e811073be5240b1 100644
--- a/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
+++ b/content/browser/renderer_host/media/audio_input_device_manager_unittest.cc
@@ -54,11 +54,6 @@ class MAYBE_AudioInputDeviceManagerTest : public testing::Test {
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.
@@ -73,6 +68,7 @@ class MAYBE_AudioInputDeviceManagerTest : public testing::Test {
&base::WaitableEvent::Signal, base::Unretained(&event)));
event.Wait();
manager_ = new AudioInputDeviceManager(audio_manager_.get());
+ manager_->UseFakeDevice();
DaleCurtis 2014/05/06 17:36:52 Do you want to set this only if no real devices ex
no longer working on chromium 2014/05/07 08:55:41 Not really, the tests are designed for testing the
audio_input_listener_.reset(new MockAudioInputDeviceManagerListener());
manager_->Register(audio_input_listener_.get(),
message_loop_->message_loop_proxy().get());
@@ -106,8 +102,6 @@ class MAYBE_AudioInputDeviceManagerTest : public testing::Test {
// Opens and closes the devices.
TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenAndCloseDevice) {
- if (!CanRunAudioInputDeviceTests())
- return;
ASSERT_FALSE(devices_.empty());
@@ -137,9 +131,6 @@ TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenAndCloseDevice) {
// Opens multiple devices at one time and closes them later.
TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenMultipleDevices) {
- if (!CanRunAudioInputDeviceTests())
- return;
-
ASSERT_FALSE(devices_.empty());
InSequence s;
@@ -183,8 +174,6 @@ TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenMultipleDevices) {
// Opens a non-existing device.
TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenNotExistingDevice) {
- if (!CanRunAudioInputDeviceTests())
- return;
InSequence s;
MediaStreamType stream_type = MEDIA_DEVICE_AUDIO_CAPTURE;
@@ -206,9 +195,6 @@ TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenNotExistingDevice) {
// Opens default device twice.
TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenDeviceTwice) {
- if (!CanRunAudioInputDeviceTests())
- return;
-
ASSERT_FALSE(devices_.empty());
InSequence s;
@@ -242,9 +228,6 @@ TEST_F(MAYBE_AudioInputDeviceManagerTest, OpenDeviceTwice) {
// Accesses then closes the sessions after opening the devices.
TEST_F(MAYBE_AudioInputDeviceManagerTest, AccessAndCloseSession) {
- if (!CanRunAudioInputDeviceTests())
- return;
-
ASSERT_FALSE(devices_.empty());
InSequence s;
@@ -278,8 +261,6 @@ TEST_F(MAYBE_AudioInputDeviceManagerTest, AccessAndCloseSession) {
// 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