OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "gpu/ipc/service/gpu_channel_test_common.h" | 5 #include "gpu/ipc/service/gpu_channel_test_common.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 ->sink(); | 120 ->sink(); |
121 | 121 |
122 // Some IPCs (such as GpuCommandBufferMsg_Initialize) will generate more | 122 // Some IPCs (such as GpuCommandBufferMsg_Initialize) will generate more |
123 // delayed responses, drop those if they exist. | 123 // delayed responses, drop those if they exist. |
124 sink->ClearMessages(); | 124 sink->ClearMessages(); |
125 | 125 |
126 // Needed to appease DCHECKs. | 126 // Needed to appease DCHECKs. |
127 msg->set_unblock(false); | 127 msg->set_unblock(false); |
128 | 128 |
129 // Message filter gets message first on IO thread. | 129 // Message filter gets message first on IO thread. |
130 channel->filter()->OnMessageReceived(*msg); | 130 channel->HandleMessageForTesting(*msg); |
131 | 131 |
132 // Run the HandleMessage task posted to the main thread. | 132 // Run the HandleMessage task posted to the main thread. |
133 task_runner()->RunPendingTasks(); | 133 task_runner()->RunPendingTasks(); |
134 | 134 |
135 // Replies are sent to the sink. | 135 // Replies are sent to the sink. |
136 if (msg->is_sync()) { | 136 if (msg->is_sync()) { |
137 const IPC::Message* reply_msg = sink->GetMessageAt(0); | 137 const IPC::Message* reply_msg = sink->GetMessageAt(0); |
138 ASSERT_TRUE(reply_msg); | 138 ASSERT_TRUE(reply_msg); |
139 EXPECT_TRUE(!reply_msg->is_reply_error()); | 139 EXPECT_TRUE(!reply_msg->is_reply_error()); |
140 | 140 |
(...skipping 13 matching lines...) Expand all Loading... |
154 delete msg; | 154 delete msg; |
155 } | 155 } |
156 | 156 |
157 base::SharedMemoryHandle GpuChannelTestCommon::GetSharedHandle() { | 157 base::SharedMemoryHandle GpuChannelTestCommon::GetSharedHandle() { |
158 base::SharedMemory shared_memory; | 158 base::SharedMemory shared_memory; |
159 shared_memory.CreateAnonymous(10); | 159 shared_memory.CreateAnonymous(10); |
160 return shared_memory.handle().Duplicate(); | 160 return shared_memory.handle().Duplicate(); |
161 } | 161 } |
162 | 162 |
163 } // namespace gpu | 163 } // namespace gpu |
OLD | NEW |