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

Side by Side Diff: content/browser/renderer_host/media/audio_input_device_manager_unittest.cc

Issue 11783059: Ensures that WebRTC works for device selection using a different sample rate than default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix after review from Chris Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 // Opens a non-existing device. 197 // Opens a non-existing device.
198 TEST_F(AudioInputDeviceManagerTest, OpenNotExistingDevice) { 198 TEST_F(AudioInputDeviceManagerTest, OpenNotExistingDevice) {
199 if (!CanRunAudioInputDeviceTests()) 199 if (!CanRunAudioInputDeviceTests())
200 return; 200 return;
201 InSequence s; 201 InSequence s;
202 202
203 MediaStreamType stream_type = MEDIA_DEVICE_AUDIO_CAPTURE; 203 MediaStreamType stream_type = MEDIA_DEVICE_AUDIO_CAPTURE;
204 std::string device_name("device_doesnt_exist"); 204 std::string device_name("device_doesnt_exist");
205 std::string device_id("id_doesnt_exist"); 205 std::string device_id("id_doesnt_exist");
206 StreamDeviceInfo dummy_device(stream_type, device_name, device_id, false); 206 int sample_rate(0);
207 int channel_config(0);
208 StreamDeviceInfo dummy_device(
209 stream_type, device_name, device_id, sample_rate, channel_config, false);
207 210
208 int session_id = manager_->Open(dummy_device); 211 int session_id = manager_->Open(dummy_device);
209 EXPECT_CALL(*audio_input_listener_, 212 EXPECT_CALL(*audio_input_listener_,
210 Opened(MEDIA_DEVICE_AUDIO_CAPTURE, session_id)) 213 Opened(MEDIA_DEVICE_AUDIO_CAPTURE, session_id))
211 .Times(1); 214 .Times(1);
212 215
213 // Waits for the callback. 216 // Waits for the callback.
214 message_loop_->RunUntilIdle(); 217 message_loop_->RunUntilIdle();
215 } 218 }
216 219
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 469
467 manager_->Stop(session_id); 470 manager_->Stop(session_id);
468 manager_->Close(session_id); 471 manager_->Close(session_id);
469 EXPECT_CALL(*audio_input_listener_, 472 EXPECT_CALL(*audio_input_listener_,
470 Closed(MEDIA_DEVICE_AUDIO_CAPTURE, session_id)) 473 Closed(MEDIA_DEVICE_AUDIO_CAPTURE, session_id))
471 .Times(1); 474 .Times(1);
472 message_loop_->RunUntilIdle(); 475 message_loop_->RunUntilIdle();
473 } 476 }
474 477
475 } // namespace content 478 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698