| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 400 |
| 401 // This test must be aligned with the policy of supported tracks. | 401 // This test must be aligned with the policy of supported tracks. |
| 402 SupportedTrackPolicy p; | 402 SupportedTrackPolicy p; |
| 403 p[MEDIA_NO_SERVICE] = false; | 403 p[MEDIA_NO_SERVICE] = false; |
| 404 p[MEDIA_DEVICE_AUDIO_CAPTURE] = true; // The only one supported for now. | 404 p[MEDIA_DEVICE_AUDIO_CAPTURE] = true; // The only one supported for now. |
| 405 p[MEDIA_DEVICE_VIDEO_CAPTURE] = false; | 405 p[MEDIA_DEVICE_VIDEO_CAPTURE] = false; |
| 406 p[MEDIA_TAB_AUDIO_CAPTURE] = false; | 406 p[MEDIA_TAB_AUDIO_CAPTURE] = false; |
| 407 p[MEDIA_TAB_VIDEO_CAPTURE] = false; | 407 p[MEDIA_TAB_VIDEO_CAPTURE] = false; |
| 408 p[MEDIA_DESKTOP_VIDEO_CAPTURE] = false; | 408 p[MEDIA_DESKTOP_VIDEO_CAPTURE] = false; |
| 409 p[MEDIA_DESKTOP_AUDIO_CAPTURE] = false; | 409 p[MEDIA_DESKTOP_AUDIO_CAPTURE] = false; |
| 410 p[MEDIA_DEVICE_AUDIO_OUTPUT] = false; | |
| 411 | 410 |
| 412 // Ensure this test gets updated along with |content::MediaStreamType| enum. | 411 // Ensure this test gets updated along with |content::MediaStreamType| enum. |
| 413 EXPECT_EQ(NUM_MEDIA_TYPES, p.size()); | 412 EXPECT_EQ(NUM_MEDIA_TYPES, p.size()); |
| 414 | 413 |
| 415 // Check the the entire policy. | 414 // Check the the entire policy. |
| 416 for (SupportedTrackPolicy::iterator it = p.begin(); it != p.end(); ++it) { | 415 for (SupportedTrackPolicy::iterator it = p.begin(); it != p.end(); ++it) { |
| 417 blink::WebMediaStreamTrack blink_track; | 416 blink::WebMediaStreamTrack blink_track; |
| 418 PrepareBlinkTrackOfType(it->first, &blink_track); | 417 PrepareBlinkTrackOfType(it->first, &blink_track); |
| 419 ASSERT_EQ( | 418 ASSERT_EQ( |
| 420 it->second, | 419 it->second, |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 const uint32_t buffers_per_notification = Initialize(44100, 441, 16000, 1600); | 539 const uint32_t buffers_per_notification = Initialize(44100, 441, 16000, 1600); |
| 541 AssertConsumedBuffers(0U); | 540 AssertConsumedBuffers(0U); |
| 542 CaptureAudioAndAssertConsumedBuffers(buffers_per_notification, 1U); | 541 CaptureAudioAndAssertConsumedBuffers(buffers_per_notification, 1U); |
| 543 EXPECT_CALL(*this, StoppedCallback()).Times(1); | 542 EXPECT_CALL(*this, StoppedCallback()).Times(1); |
| 544 | 543 |
| 545 native_track()->Stop(); | 544 native_track()->Stop(); |
| 546 CaptureAudioAndAssertConsumedBuffers(buffers_per_notification, 1U); | 545 CaptureAudioAndAssertConsumedBuffers(buffers_per_notification, 1U); |
| 547 } | 546 } |
| 548 | 547 |
| 549 } // namespace content | 548 } // namespace content |
| OLD | NEW |