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

Unified Diff: media/audio/mac/audio_device_listener_mac_unittest.cc

Issue 11344005: Handle audio device changes on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years, 2 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
« no previous file with comments | « media/audio/mac/audio_device_listener_mac.cc ('k') | media/audio/mac/audio_low_latency_output_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/mac/audio_device_listener_mac_unittest.cc
diff --git a/media/audio/mac/audio_device_listener_mac_unittest.cc b/media/audio/mac/audio_device_listener_mac_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..c2c75c916805d2d0c92b1641bccf95d6ccf925eb
--- /dev/null
+++ b/media/audio/mac/audio_device_listener_mac_unittest.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2012 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 "base/bind.h"
+#include "media/audio/mac/audio_device_listener_mac.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+class AudioDeviceListenerDelegate {
+ public:
+ MOCK_METHOD0(OnDeviceChange, void());
+};
+
+} // namespace
+
+namespace media {
+
+// Simulate a device change event and ensure we get the right callback.
+TEST(AudioDeviceListenerMacTest, OutputDeviceChange) {
+ AudioDeviceListenerDelegate delegate;
+ AudioDeviceListenerMac output_device_listener(base::Bind(
+ &AudioDeviceListenerDelegate::OnDeviceChange,
+ base::Unretained(&delegate)));
+ EXPECT_CALL(delegate, OnDeviceChange()).Times(1);
+ output_device_listener.OnDefaultDeviceChanged();
+}
+
+} // namespace media
« no previous file with comments | « media/audio/mac/audio_device_listener_mac.cc ('k') | media/audio/mac/audio_low_latency_output_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698