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

Side by Side Diff: chromecast/media/audio/cast_audio_manager_factory_test.cc

Issue 1105803002: Exposes a shlib interface for media/audio path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment out streaming test until the default implementation is improved. Created 5 years, 4 months 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
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698