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

Unified Diff: content/test/mock_audio_stream_registry.cc

Issue 2578983003: Add AudioStreamRegistry. Move stream counting logic (Closed)
Patch Set: Add missing EXPECT_TRUE. Created 4 years 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: content/test/mock_audio_stream_registry.cc
diff --git a/content/test/mock_audio_stream_registry.cc b/content/test/mock_audio_stream_registry.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ba74193dc40ad16c28477d361b95ad631f519d65
--- /dev/null
+++ b/content/test/mock_audio_stream_registry.cc
@@ -0,0 +1,33 @@
+// Copyright 2016 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.
+
+#ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_AUDIO_STREAM_REGISTRY_H_
+#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_AUDIO_STREAM_REGISTRY_H_
+
+#include "content/test/mock_audio_stream_registry.h"
+
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace content {
+
+MockAudioStreamRegistry::MockAudioStreamRegistry(int render_process_id)
+ : impl_(render_process_id) {
+ // AudioStreamRegistryImpl has many DCHECKs. We reuse them here by
+ // forwarding all calls.
+ ON_CALL(*this, RegisterOutputStream(testing::_))
+ .WillByDefault(
+ testing::Invoke(&impl_, &AudioStreamRegistry::RegisterOutputStream));
+ ON_CALL(*this, DeregisterOutputStream(testing::_))
+ .WillByDefault(testing::Invoke(
+ &impl_, &AudioStreamRegistry::DeregisterOutputStream));
+ ON_CALL(*this, OutputStreamStateChanged(testing::_, testing::_))
+ .WillByDefault(testing::Invoke(
+ &impl_, &AudioStreamRegistry::OutputStreamStateChanged));
+}
+
+MockAudioStreamRegistry::~MockAudioStreamRegistry() {}
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MOCK_AUDIO_STREAM_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698