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

Unified 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, 5 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 side-by-side diff with in-line comments
Download patch
Index: chromecast/media/audio/cast_audio_manager_factory_test.cc
diff --git a/chromecast/media/audio/cast_audio_manager_factory_test.cc b/chromecast/media/audio/cast_audio_manager_factory_test.cc
new file mode 100644
index 0000000000000000000000000000000000000000..10ffb981341195f81af94066e9479b3562ecaf96
--- /dev/null
+++ b/chromecast/media/audio/cast_audio_manager_factory_test.cc
@@ -0,0 +1,34 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromecast/media/audio/cast_audio_manager.h"
+#include "chromecast/media/audio/cast_audio_manager_factory.h"
+#include "chromecast/public/cast_media_shlib.h"
+#include "chromecast/public/media/cast_audio_output_device.h"
+#include "media/audio/audio_manager.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace chromecast {
+namespace media {
+
+// This is a very simple test which verifies that setting a
+// CastAudioManagerFactory will delegate calls on AudioManager and
+// AudioOutputStream to to the CastMediaShlib layer. Testing the behavior of
+// each call in the AudioManager implementation itself shall occur elsewhere.
+TEST(CastAudioManagerFactoryTest, AudioOutputDeviceIsUsed) {
+ ::media::AudioManager::SetFactory(new CastAudioManagerFactory());
+ ::media::AudioManager* manager = ::media::AudioManager::CreateForTesting();
+ ASSERT_TRUE(manager);
+
+ // Check that the correct AudioManager is being used, and that the underlying
+ // delegate is the CastMediaShlib object.
+ const CastAudioOutputDevice* output_device =
+ CastMediaShlib::GetAudioOutputDevice();
+ ASSERT_TRUE(output_device);
+ CastAudioManager* cast_manager = reinterpret_cast<CastAudioManager*>(manager);
+ EXPECT_EQ(cast_manager->GetAudioOutputDeviceForTesting(), output_device);
+}
+
+} // namespace media
+} // namespace chromecast

Powered by Google App Engine
This is Rietveld 408576698