Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/synchronization/waitable_event.h" | 6 #include "base/synchronization/waitable_event.h" |
| 7 #include "chromecast/base/metrics/cast_metrics_test_helper.h" | 7 #include "chromecast/base/metrics/cast_metrics_test_helper.h" |
| 8 #include "chromecast/media/audio/cast_audio_manager.h" | 8 #include "chromecast/media/audio/cast_audio_manager.h" |
| 9 #include "chromecast/media/audio/cast_audio_output_stream.h" | 9 #include "chromecast/media/audio/cast_audio_output_stream.h" |
| 10 #include "chromecast/media/base/media_message_loop.h" | 10 #include "chromecast/media/base/media_message_loop.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 374 format_ = format[i]; | 374 format_ = format[i]; |
| 375 ::media::AudioOutputStream* stream = CreateStream(); | 375 ::media::AudioOutputStream* stream = CreateStream(); |
| 376 ASSERT_TRUE(stream); | 376 ASSERT_TRUE(stream); |
| 377 EXPECT_TRUE(OpenStream(stream)); | 377 EXPECT_TRUE(OpenStream(stream)); |
| 378 | 378 |
| 379 FakeAudioDecoder* audio_decoder = GetAudio(); | 379 FakeAudioDecoder* audio_decoder = GetAudio(); |
| 380 ASSERT_TRUE(audio_decoder); | 380 ASSERT_TRUE(audio_decoder); |
| 381 const AudioConfig& audio_config = audio_decoder->config(); | 381 const AudioConfig& audio_config = audio_decoder->config(); |
| 382 EXPECT_EQ(kCodecPCM, audio_config.codec); | 382 EXPECT_EQ(kCodecPCM, audio_config.codec); |
| 383 EXPECT_EQ(kSampleFormatS16, audio_config.sample_format); | 383 EXPECT_EQ(kSampleFormatS16, audio_config.sample_format); |
| 384 EXPECT_FALSE(audio_config.is_encrypted); | 384 EXPECT_FALSE(audio_config.encryption_scheme.is_encrypted); |
|
ddorwin
2015/12/10 18:36:00
Do we not have any similar tests for non-Chromecas
ddorwin
2015/12/10 18:36:00
Are there other members we can/should test?
dougsteed
2015/12/14 21:19:01
Pretty sure I updated all the tests, as it would n
dougsteed
2015/12/14 21:19:01
Do you mean members of audio_config, or of audio_c
ddorwin
2016/03/01 02:17:40
I was referring to EncryptionScheme. The values sh
ddorwin
2016/03/01 02:17:41
This comment doesn't actually apply here. I moved
| |
| 385 | 385 |
| 386 CloseStream(stream); | 386 CloseStream(stream); |
| 387 } | 387 } |
| 388 } | 388 } |
| 389 | 389 |
| 390 TEST_F(CastAudioOutputStreamTest, ChannelLayout) { | 390 TEST_F(CastAudioOutputStreamTest, ChannelLayout) { |
| 391 ::media::ChannelLayout layout[] = {::media::CHANNEL_LAYOUT_MONO, | 391 ::media::ChannelLayout layout[] = {::media::CHANNEL_LAYOUT_MONO, |
| 392 ::media::CHANNEL_LAYOUT_STEREO}; | 392 ::media::CHANNEL_LAYOUT_STEREO}; |
| 393 for (size_t i = 0; i < arraysize(layout); ++i) { | 393 for (size_t i = 0; i < arraysize(layout); ++i) { |
| 394 channel_layout_ = layout[i]; | 394 channel_layout_ = layout[i]; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 643 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { | 643 TEST_F(CastAudioOutputStreamTest, CloseWithoutStart) { |
| 644 ::media::AudioOutputStream* stream = CreateStream(); | 644 ::media::AudioOutputStream* stream = CreateStream(); |
| 645 ASSERT_TRUE(stream); | 645 ASSERT_TRUE(stream); |
| 646 ASSERT_TRUE(OpenStream(stream)); | 646 ASSERT_TRUE(OpenStream(stream)); |
| 647 CloseStream(stream); | 647 CloseStream(stream); |
| 648 } | 648 } |
| 649 | 649 |
| 650 } // namespace | 650 } // namespace |
| 651 } // namespace media | 651 } // namespace media |
| 652 } // namespace chromecast | 652 } // namespace chromecast |
| OLD | NEW |