OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
6 #include "base/test/simple_test_tick_clock.h" | 6 #include "base/test/simple_test_tick_clock.h" |
| 7 #include "base/thread_task_runner_handle.h" |
7 #include "chrome/common/cast_messages.h" | 8 #include "chrome/common/cast_messages.h" |
8 #include "chrome/renderer/media/cast_ipc_dispatcher.h" | 9 #include "chrome/renderer/media/cast_ipc_dispatcher.h" |
9 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
10 #include "media/cast/logging/logging_defines.h" | 11 #include "media/cast/logging/logging_defines.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
12 | 13 |
13 namespace { | 14 namespace { |
14 | 15 |
15 class CastIPCDispatcherTest : public testing::Test { | 16 class CastIPCDispatcherTest : public testing::Test { |
16 public: | 17 public: |
17 CastIPCDispatcherTest() { | 18 CastIPCDispatcherTest() { |
18 dispatcher_ = new CastIPCDispatcher(base::MessageLoopProxy::current()); | 19 dispatcher_ = new CastIPCDispatcher(base::ThreadTaskRunnerHandle::Get()); |
19 } | 20 } |
20 | 21 |
21 protected: | 22 protected: |
22 void FakeSend(const IPC::Message& message) { | 23 void FakeSend(const IPC::Message& message) { |
23 EXPECT_TRUE(dispatcher_->OnMessageReceived(message)); | 24 EXPECT_TRUE(dispatcher_->OnMessageReceived(message)); |
24 } | 25 } |
25 | 26 |
26 scoped_refptr<CastIPCDispatcher> dispatcher_; | 27 scoped_refptr<CastIPCDispatcher> dispatcher_; |
27 base::MessageLoopForIO message_loop_; | 28 base::MessageLoopForIO message_loop_; |
28 }; | 29 }; |
(...skipping 22 matching lines...) Expand all Loading... |
51 frame_events.push_back(frame_event); | 52 frame_events.push_back(frame_event); |
52 | 53 |
53 packet_events.push_back(packet_event); | 54 packet_events.push_back(packet_event); |
54 CastMsg_RawEvents raw_events_msg(kChannelId, packet_events, | 55 CastMsg_RawEvents raw_events_msg(kChannelId, packet_events, |
55 frame_events); | 56 frame_events); |
56 | 57 |
57 FakeSend(raw_events_msg); | 58 FakeSend(raw_events_msg); |
58 } | 59 } |
59 | 60 |
60 } // namespace | 61 } // namespace |
OLD | NEW |