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

Unified Diff: chrome/renderer/media/cast_ipc_dispatcher_unittest.cc

Issue 279833003: Cast: Add missing enum and PacketEvent field to cast_messages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « chrome/common/cast_messages.h ('k') | media/cast/logging/encoding_event_subscriber.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/media/cast_ipc_dispatcher_unittest.cc
diff --git a/chrome/renderer/media/cast_ipc_dispatcher_unittest.cc b/chrome/renderer/media/cast_ipc_dispatcher_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1f330a172a8a2be1169ec8b1a2a74c64e6bf733c
--- /dev/null
+++ b/chrome/renderer/media/cast_ipc_dispatcher_unittest.cc
@@ -0,0 +1,49 @@
+// Copyright 2014 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/message_loop/message_loop.h"
+#include "base/test/simple_test_tick_clock.h"
+#include "chrome/common/cast_messages.h"
+#include "chrome/renderer/media/cast_ipc_dispatcher.h"
+#include "ipc/ipc_message_macros.h"
+#include "media/cast/logging/logging_defines.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+class CastIPCDispatcherTest : public testing::Test {
+ public:
+ CastIPCDispatcherTest() {
+ dispatcher_ = new CastIPCDispatcher(base::MessageLoopProxy::current());
+ }
+
+ protected:
+ void FakeSend(const IPC::Message& message) {
+ EXPECT_TRUE(dispatcher_->OnMessageReceived(message));
+ }
+
+ scoped_refptr<CastIPCDispatcher> dispatcher_;
+ base::MessageLoopForIO message_loop_;
+};
+
+TEST_F(CastIPCDispatcherTest, RawEvents) {
+ const int kChannelId = 17;
+ std::vector<media::cast::PacketEvent> packet_events;
+ media::cast::PacketEvent packet_event;
+ packet_event.rtp_timestamp = 100;
+ packet_event.max_packet_id = 10;
+ packet_event.packet_id = 5;
+ packet_event.size = 512;
+ packet_event.timestamp = base::SimpleTestTickClock().NowTicks();
+ packet_event.type = media::cast::PACKET_SENT_TO_NETWORK;
+ packet_event.media_type = media::cast::VIDEO_EVENT;
+
+ packet_events.push_back(packet_event);
+ CastMsg_RawEvents raw_events_msg(kChannelId, packet_events);
+
+ FakeSend(raw_events_msg);
+}
+
+} // namespace
+
« no previous file with comments | « chrome/common/cast_messages.h ('k') | media/cast/logging/encoding_event_subscriber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698