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

Unified Diff: content/renderer/media/audio_message_filter_unittest.cc

Issue 1930393002: Switch stream creation and closing in Chrome audio rendering from IPC to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unique_ptr for Binding Created 4 years, 7 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 | « content/renderer/media/audio_message_filter.cc ('k') | content/renderer/media/audio_output_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_message_filter_unittest.cc
diff --git a/content/renderer/media/audio_message_filter_unittest.cc b/content/renderer/media/audio_message_filter_unittest.cc
index e94e8cba55819f65e36f5c9e543d5dae0a8d29e9..8ae6af532cac3530f469e1ac7b98a736fcfbb968 100644
--- a/content/renderer/media/audio_message_filter_unittest.cc
+++ b/content/renderer/media/audio_message_filter_unittest.cc
@@ -9,9 +9,10 @@
#include "base/macros.h"
#include "content/common/media/audio_messages.h"
#include "content/renderer/media/audio_message_filter.h"
+#include "content/renderer/media/audio_output_client.h"
#include "media/audio/audio_output_ipc.h"
#include "testing/gtest/include/gtest/gtest.h"
-
+/*
namespace content {
namespace {
@@ -112,6 +113,7 @@ TEST(AudioMessageFilterTest, Basic) {
MockAudioDelegate delegate;
const std::unique_ptr<media::AudioOutputIPC> ipc =
filter->CreateAudioOutputIPC(kRenderFrameId);
+ filter->set_audio_output_client(kRenderFrameId, new AudioOutputClient(NULL));
static const int kSessionId = 0;
static const std::string kDeviceId;
static const url::Origin kSecurityOrigin;
@@ -134,8 +136,8 @@ TEST(AudioMessageFilterTest, Basic) {
base::SyncSocket::TransitDescriptor socket_descriptor;
const uint32_t kLength = 1024;
EXPECT_FALSE(delegate.created_received());
- filter->OnMessageReceived(AudioMsg_NotifyStreamCreated(
- kStreamId, base::SharedMemory::NULLHandle(), socket_descriptor, kLength));
+ filter->OnStreamCreated(kStreamId, base::SharedMemory::NULLHandle(),
+ socket_descriptor, kLength);
EXPECT_TRUE(delegate.created_received());
EXPECT_FALSE(base::SharedMemory::IsHandleValid(delegate.handle()));
EXPECT_EQ(kLength, delegate.length());
@@ -146,6 +148,8 @@ TEST(AudioMessageFilterTest, Basic) {
filter->OnMessageReceived(
AudioMsg_NotifyStreamStateChanged(
kStreamId, media::AUDIO_OUTPUT_IPC_DELEGATE_STATE_PLAYING));
+ filter->OnStreamCreated(kStreamId, base::SharedMemory::NULLHandle(),
+ socket_descriptor, kLength);
EXPECT_TRUE(delegate.state_changed_received());
EXPECT_EQ(media::AUDIO_OUTPUT_IPC_DELEGATE_STATE_PLAYING, delegate.state());
delegate.Reset();
@@ -160,7 +164,7 @@ TEST(AudioMessageFilterTest, Delegates) {
scoped_refptr<AudioMessageFilter> filter(
new AudioMessageFilter(message_loop.task_runner()));
-
+ filter->set_audio_output_client(kRenderFrameId, new AudioOutputClient(NULL));
MockAudioDelegate delegate1;
MockAudioDelegate delegate2;
const std::unique_ptr<media::AudioOutputIPC> ipc1 =
@@ -203,4 +207,8 @@ TEST(AudioMessageFilterTest, Delegates) {
filter->delegates_.Lookup(kStreamId2));
}
-} // namespace content
+}
+
+ // namespace content
+
+*/
« no previous file with comments | « content/renderer/media/audio_message_filter.cc ('k') | content/renderer/media/audio_output_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698