OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chromecast/media/audio/cast_audio_manager.h" |
| 6 #include "chromecast/media/audio/cast_audio_manager_factory.h" |
| 7 #include "chromecast/public/cast_media_shlib.h" |
| 8 #include "chromecast/public/media/cast_audio_output_device.h" |
| 9 #include "media/audio/audio_manager.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 |
| 12 namespace chromecast { |
| 13 namespace media { |
| 14 |
| 15 // This is a very simple test which verifies that setting a |
| 16 // CastAudioManagerFactory will delegate calls on AudioManager and |
| 17 // AudioOutputStream to to the CastMediaShlib layer. Testing the behavior of |
| 18 // each call in the AudioManager implementation itself shall occur elsewhere. |
| 19 TEST(CastAudioManagerFactoryTest, AudioOutputDeviceIsUsed) { |
| 20 ::media::AudioManager::SetFactory(new CastAudioManagerFactory()); |
| 21 ::media::AudioManager* manager = ::media::AudioManager::CreateForTesting(); |
| 22 ASSERT_TRUE(manager); |
| 23 |
| 24 // Check that the correct AudioManager is being used, and that the underlying |
| 25 // delegate is the CastMediaShlib object. |
| 26 const CastAudioOutputDevice* output_device = |
| 27 CastMediaShlib::GetAudioOutputDevice(); |
| 28 ASSERT_TRUE(output_device); |
| 29 CastAudioManager* cast_manager = reinterpret_cast<CastAudioManager*>(manager); |
| 30 EXPECT_EQ(cast_manager->GetAudioOutputDeviceForTesting(), output_device); |
| 31 } |
| 32 |
| 33 } // namespace media |
| 34 } // namespace chromecast |
OLD | NEW |