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

Side by Side Diff: content/renderer/media/speech_recognition_audio_sink_unittest.cc

Issue 649543002: Replacing MEDIA_LOOPBACK_AUDIO_CAPTURE with MEDIA_DESKTOP_AUDIO_CAPTURE (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase the patchset Created 6 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 unified diff | Download patch
« no previous file with comments | « content/public/common/media_stream_request.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/renderer/media/speech_recognition_audio_sink.h" 5 #include "content/renderer/media/speech_recognition_audio_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/renderer/media/media_stream_audio_source.h" 9 #include "content/renderer/media/media_stream_audio_source.h"
10 #include "content/renderer/media/mock_media_constraint_factory.h" 10 #include "content/renderer/media/mock_media_constraint_factory.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 typedef std::map<MediaStreamType, bool> SupportedTrackPolicy; 368 typedef std::map<MediaStreamType, bool> SupportedTrackPolicy;
369 369
370 // This test must be aligned with the policy of supported tracks. 370 // This test must be aligned with the policy of supported tracks.
371 SupportedTrackPolicy p; 371 SupportedTrackPolicy p;
372 p[MEDIA_NO_SERVICE] = false; 372 p[MEDIA_NO_SERVICE] = false;
373 p[MEDIA_DEVICE_AUDIO_CAPTURE] = true; // The only one supported for now. 373 p[MEDIA_DEVICE_AUDIO_CAPTURE] = true; // The only one supported for now.
374 p[MEDIA_DEVICE_VIDEO_CAPTURE] = false; 374 p[MEDIA_DEVICE_VIDEO_CAPTURE] = false;
375 p[MEDIA_TAB_AUDIO_CAPTURE] = false; 375 p[MEDIA_TAB_AUDIO_CAPTURE] = false;
376 p[MEDIA_TAB_VIDEO_CAPTURE] = false; 376 p[MEDIA_TAB_VIDEO_CAPTURE] = false;
377 p[MEDIA_DESKTOP_VIDEO_CAPTURE] = false; 377 p[MEDIA_DESKTOP_VIDEO_CAPTURE] = false;
378 p[MEDIA_LOOPBACK_AUDIO_CAPTURE] = false; 378 p[MEDIA_DESKTOP_AUDIO_CAPTURE] = false;
379 p[MEDIA_DEVICE_AUDIO_OUTPUT] = false; 379 p[MEDIA_DEVICE_AUDIO_OUTPUT] = false;
380 380
381 // Ensure this test gets updated along with |content::MediaStreamType| enum. 381 // Ensure this test gets updated along with |content::MediaStreamType| enum.
382 EXPECT_EQ(NUM_MEDIA_TYPES, p.size()); 382 EXPECT_EQ(NUM_MEDIA_TYPES, p.size());
383 383
384 // Check the the entire policy. 384 // Check the the entire policy.
385 for (SupportedTrackPolicy::iterator it = p.begin(); it != p.end(); ++it) { 385 for (SupportedTrackPolicy::iterator it = p.begin(); it != p.end(); ++it) {
386 blink::WebMediaStreamTrack blink_track; 386 blink::WebMediaStreamTrack blink_track;
387 PrepareBlinkTrackOfType(it->first, &blink_track); 387 PrepareBlinkTrackOfType(it->first, &blink_track);
388 ASSERT_EQ( 388 ASSERT_EQ(
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 const uint32 kBuffersPerNotification = Initialize(44100, 441, 16000, 1600); 505 const uint32 kBuffersPerNotification = Initialize(44100, 441, 16000, 1600);
506 AssertConsumedBuffers(0U); 506 AssertConsumedBuffers(0U);
507 CaptureAudioAndAssertConsumedBuffers(kBuffersPerNotification, 1U); 507 CaptureAudioAndAssertConsumedBuffers(kBuffersPerNotification, 1U);
508 EXPECT_CALL(*this, StoppedCallback()).Times(1); 508 EXPECT_CALL(*this, StoppedCallback()).Times(1);
509 509
510 native_track()->Stop(); 510 native_track()->Stop();
511 CaptureAudioAndAssertConsumedBuffers(kBuffersPerNotification, 1U); 511 CaptureAudioAndAssertConsumedBuffers(kBuffersPerNotification, 1U);
512 } 512 }
513 513
514 } // namespace content 514 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/media_stream_request.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698