content/renderer/media/audio_renderer_mixer_manager_unittest.cc
// Verify CreateInput() provides AudioRendererMixerInput with the appropriate
// callbacks and they are working as expected.
Verify CreateInput() provides AudioRendererMixerInput with the appropriate
callbacks and they are working as expected.
Verify CreateInput () provides AudioRendererMixerInput with the appropriate callbacks and they are working as expected .
TEST_F(AudioRendererMixerManagerTest, CreateInput) {
  EXPECT_CALL(*mock_sink_, Start()).Times(1);
  EXPECT_CALL(*mock_sink_, Stop()).Times(1);
  media::AudioParameters params(
      media::AudioParameters::AUDIO_PCM_LINEAR, kChannelLayout, kSampleRate,
      kBitsPerChannel, kBufferSize);
  EXPECT_EQ(mixer_count(), 0);
  scoped_refptr<media::AudioRendererMixerInput> input(manager_->CreateInput());
  EXPECT_EQ(mixer_count(), 0);
  media::FakeAudioRenderCallback callback(0);
  input->Initialize(params, &callback);
  EXPECT_EQ(mixer_count(), 1);
  input = NULL;
  EXPECT_EQ(mixer_count(), 0);
}
TEST_F ( AudioRendererMixerManagerTest , CreateInput ) { EXPECT_CALL ( * mock_sink_ , Start ( ) ) . Times ( 1 ) ; EXPECT_CALL ( * mock_sink_ , Stop ( ) ) . Times ( 1 ) ; media :: AudioParameters params ( media :: AudioParameters :: AUDIO_PCM_LINEAR , kChannelLayout , kSampleRate , kBitsPerChannel , kBufferSize ) ; EXPECT_EQ ( mixer_count ( ) , 0 ) ; scoped_refptr < media :: AudioRendererMixerInput > input ( manager_ -> CreateInput ( ) ) ; EXPECT_EQ ( mixer_count ( ) , 0 ) ; media :: FakeAudioRenderCallback callback ( 0 ) ; input -> Initialize ( params , & callback ) ; EXPECT_EQ ( mixer_count ( ) , 1 ) ; input = NULL ; EXPECT_EQ ( mixer_count ( ) , 0 ) ; }
Verify CreateInput() provides AudioRendererMixerInput with the appropriate
callbacks and they are working as expected.
Verify CreateInput () provides AudioRendererMixerInput with the appropriate callbacks and they are working as expected .
// Since we're testing only one set of parameters, we expect // AudioRendererMixerManager to call Start and Stop on our mock once each. // Create a mixer input and ensure it doesn't instantiate a mixer yet. // Implicitly test that AudioRendererMixerInput was provided with the expected // callbacks needed to acquire an AudioRendererMixer and remove it. // Destroying the input should destroy the mixer.