| 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/test/test_simple_task_runner.h" | 8 #include "base/test/test_simple_task_runner.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "gpu/command_buffer/service/sync_point_manager.h" | 10 #include "gpu/command_buffer/service/sync_point_manager.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 // Call stubs here so that any IPC messages sent are handled using the | 113 // Call stubs here so that any IPC messages sent are handled using the |
| 114 // overridden Send method. | 114 // overridden Send method. |
| 115 stubs_.clear(); | 115 stubs_.clear(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 base::ProcessId TestGpuChannel::GetClientPID() const { | 118 base::ProcessId TestGpuChannel::GetClientPID() const { |
| 119 return base::kNullProcessId; | 119 return base::kNullProcessId; |
| 120 } | 120 } |
| 121 | 121 |
| 122 IPC::ChannelHandle TestGpuChannel::Init(base::WaitableEvent* shutdown_event) { | 122 IPC::ChannelHandle TestGpuChannel::Init(base::WaitableEvent* shutdown_event) { |
| 123 channel_id_ = "ChannelMojo-gpu"; |
| 123 filter_->OnFilterAdded(&sink_); | 124 filter_->OnFilterAdded(&sink_); |
| 124 return IPC::ChannelHandle(channel_id()); | 125 return IPC::ChannelHandle(channel_id()); |
| 125 } | 126 } |
| 126 | 127 |
| 127 bool TestGpuChannel::Send(IPC::Message* msg) { | 128 bool TestGpuChannel::Send(IPC::Message* msg) { |
| 128 DCHECK(!msg->is_sync()); | 129 DCHECK(!msg->is_sync()); |
| 129 return sink_.Send(msg); | 130 return sink_.Send(msg); |
| 130 } | 131 } |
| 131 | 132 |
| 132 // TODO(sunnyps): Use a mock memory buffer factory when necessary. | 133 // TODO(sunnyps): Use a mock memory buffer factory when necessary. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 148 io_task_runner_.get(), sync_point_manager_.get(), nullptr)); | 149 io_task_runner_.get(), sync_point_manager_.get(), nullptr)); |
| 149 } | 150 } |
| 150 | 151 |
| 151 void GpuChannelTestCommon::TearDown() { | 152 void GpuChannelTestCommon::TearDown() { |
| 152 // Destroying channels causes tasks to run on the IO task runner. | 153 // Destroying channels causes tasks to run on the IO task runner. |
| 153 channel_manager_ = nullptr; | 154 channel_manager_ = nullptr; |
| 154 } | 155 } |
| 155 | 156 |
| 156 | 157 |
| 157 } // namespace gpu | 158 } // namespace gpu |
| OLD | NEW |