| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/memory/shared_memory.h" | 7 #include "base/memory/shared_memory.h" |
| 8 #include "base/test/test_message_loop.h" | 8 #include "base/test/test_message_loop.h" |
| 9 #include "gpu/ipc/common/gpu_messages.h" | 9 #include "gpu/ipc/common/gpu_messages.h" |
| 10 #include "gpu/ipc/service/gpu_channel.h" | 10 #include "gpu/ipc/service/gpu_channel.h" |
| 11 #include "gpu/ipc/service/gpu_channel_manager.h" | 11 #include "gpu/ipc/service/gpu_channel_manager.h" |
| 12 #include "gpu/ipc/service/gpu_channel_test_common.h" | 12 #include "gpu/ipc/service/gpu_channel_test_common.h" |
| 13 #include "ipc/ipc_test_sink.h" | 13 #include "ipc/ipc_test_sink.h" |
| 14 #include "ui/gl/gl_context_stub_with_extensions.h" | 14 #include "ui/gl/gl_context_stub_with_extensions.h" |
| 15 #include "ui/gl/gl_mock.h" | 15 #include "ui/gl/gl_mock.h" |
| 16 #include "ui/gl/gl_surface_stub.h" | 16 #include "ui/gl/gl_surface_stub.h" |
| 17 #include "ui/gl/init/gl_factory.h" |
| 17 #include "ui/gl/test/gl_surface_test_support.h" | 18 #include "ui/gl/test/gl_surface_test_support.h" |
| 18 | 19 |
| 19 namespace gpu { | 20 namespace gpu { |
| 20 | 21 |
| 21 static constexpr int kFakeTextureIds[] = {1, 2}; | 22 static constexpr int kFakeTextureIds[] = {1, 2}; |
| 22 | 23 |
| 23 class GpuChannelTest : public GpuChannelTestCommon { | 24 class GpuChannelTest : public GpuChannelTestCommon { |
| 24 public: | 25 public: |
| 25 GpuChannelTest() : GpuChannelTestCommon() {} | 26 GpuChannelTest() : GpuChannelTestCommon() {} |
| 26 ~GpuChannelTest() override {} | 27 ~GpuChannelTest() override {} |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 129 |
| 129 GpuChannelTestCommon::SetUp(); | 130 GpuChannelTestCommon::SetUp(); |
| 130 } | 131 } |
| 131 | 132 |
| 132 void TearDown() override { | 133 void TearDown() override { |
| 133 GpuChannelTestCommon::TearDown(); | 134 GpuChannelTestCommon::TearDown(); |
| 134 | 135 |
| 135 stub_context_ = nullptr; | 136 stub_context_ = nullptr; |
| 136 stub_surface_ = nullptr; | 137 stub_surface_ = nullptr; |
| 137 gl::MockGLInterface::SetGLInterface(nullptr); | 138 gl::MockGLInterface::SetGLInterface(nullptr); |
| 138 gl::ClearGLBindings(); | 139 gl::init::ClearGLBindings(); |
| 139 gl_interface_ = nullptr; | 140 gl_interface_ = nullptr; |
| 140 } | 141 } |
| 141 | 142 |
| 142 GpuChannel* CreateChannel(int32_t client_id, | 143 GpuChannel* CreateChannel(int32_t client_id, |
| 143 bool allow_view_command_buffers, | 144 bool allow_view_command_buffers, |
| 144 bool allow_real_time_streams) { | 145 bool allow_real_time_streams) { |
| 145 DCHECK(channel_manager()); | 146 DCHECK(channel_manager()); |
| 146 uint64_t kClientTracingId = 1; | 147 uint64_t kClientTracingId = 1; |
| 147 channel_manager()->EstablishChannel( | 148 channel_manager()->EstablishChannel( |
| 148 client_id, kClientTracingId, false /* preempts */, | 149 client_id, kClientTracingId, false /* preempts */, |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); | 506 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); |
| 506 | 507 |
| 507 // Destroy the command buffers we initialized before destoying GL. | 508 // Destroy the command buffers we initialized before destoying GL. |
| 508 HandleMessage(channel, | 509 HandleMessage(channel, |
| 509 new GpuChannelMsg_DestroyCommandBuffer(kFriendlyRouteId)); | 510 new GpuChannelMsg_DestroyCommandBuffer(kFriendlyRouteId)); |
| 510 HandleMessage(channel, | 511 HandleMessage(channel, |
| 511 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); | 512 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); |
| 512 } | 513 } |
| 513 | 514 |
| 514 } // namespace gpu | 515 } // namespace gpu |
| OLD | NEW |