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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/message_loop/message_loop.h"
6 #include "base/test/simple_test_tick_clock.h"
7 #include "chrome/common/cast_messages.h"
8 #include "chrome/renderer/media/cast_ipc_dispatcher.h"
9 #include "ipc/ipc_message_macros.h"
10 #include "media/cast/logging/logging_defines.h"
11 #include "testing/gtest/include/gtest/gtest.h"
12
13 namespace {
14
15 class CastIPCDispatcherTest : public testing::Test {
16 public:
17 CastIPCDispatcherTest() {
18 dispatcher_ = new CastIPCDispatcher(base::MessageLoopProxy::current());
19 }
20
21 protected:
22 void FakeSend(const IPC::Message& message) {
23 EXPECT_TRUE(dispatcher_->OnMessageReceived(message));
24 }
25
26 scoped_refptr<CastIPCDispatcher> dispatcher_;
27 base::MessageLoopForIO message_loop_;
28 };
29
30 TEST_F(CastIPCDispatcherTest, RawEvents) {
31 const int kChannelId = 17;
32 std::vector<media::cast::PacketEvent> packet_events;
33 media::cast::PacketEvent packet_event;
34 packet_event.rtp_timestamp = 100;
35 packet_event.max_packet_id = 10;
36 packet_event.packet_id = 5;
37 packet_event.size = 512;
38 packet_event.timestamp = base::SimpleTestTickClock().NowTicks();
39 packet_event.type = media::cast::PACKET_SENT_TO_NETWORK;
40 packet_event.media_type = media::cast::VIDEO_EVENT;
41
42 packet_events.push_back(packet_event);
43 CastMsg_RawEvents raw_events_msg(kChannelId, packet_events);
44
45 FakeSend(raw_events_msg);
46 }
47
48 } // namespace
49
OLDNEW
« 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