| 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" | |
| 18 #include "ui/gl/test/gl_surface_test_support.h" | 17 #include "ui/gl/test/gl_surface_test_support.h" |
| 19 | 18 |
| 20 namespace gpu { | 19 namespace gpu { |
| 21 | 20 |
| 22 static constexpr int kFakeTextureIds[] = {1, 2}; | 21 static constexpr int kFakeTextureIds[] = {1, 2}; |
| 23 | 22 |
| 24 class GpuChannelTest : public GpuChannelTestCommon { | 23 class GpuChannelTest : public GpuChannelTestCommon { |
| 25 public: | 24 public: |
| 26 GpuChannelTest() : GpuChannelTestCommon() {} | 25 GpuChannelTest() : GpuChannelTestCommon() {} |
| 27 ~GpuChannelTest() override {} | 26 ~GpuChannelTest() override {} |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 128 |
| 130 GpuChannelTestCommon::SetUp(); | 129 GpuChannelTestCommon::SetUp(); |
| 131 } | 130 } |
| 132 | 131 |
| 133 void TearDown() override { | 132 void TearDown() override { |
| 134 GpuChannelTestCommon::TearDown(); | 133 GpuChannelTestCommon::TearDown(); |
| 135 | 134 |
| 136 stub_context_ = nullptr; | 135 stub_context_ = nullptr; |
| 137 stub_surface_ = nullptr; | 136 stub_surface_ = nullptr; |
| 138 gl::MockGLInterface::SetGLInterface(nullptr); | 137 gl::MockGLInterface::SetGLInterface(nullptr); |
| 139 gl::init::ClearGLBindings(); | 138 gl::ClearGLBindings(); |
| 140 gl_interface_ = nullptr; | 139 gl_interface_ = nullptr; |
| 141 } | 140 } |
| 142 | 141 |
| 143 GpuChannel* CreateChannel(int32_t client_id, | 142 GpuChannel* CreateChannel(int32_t client_id, |
| 144 bool allow_view_command_buffers, | 143 bool allow_view_command_buffers, |
| 145 bool allow_real_time_streams) { | 144 bool allow_real_time_streams) { |
| 146 DCHECK(channel_manager()); | 145 DCHECK(channel_manager()); |
| 147 uint64_t kClientTracingId = 1; | 146 uint64_t kClientTracingId = 1; |
| 148 channel_manager()->EstablishChannel( | 147 channel_manager()->EstablishChannel( |
| 149 client_id, kClientTracingId, false /* preempts */, | 148 client_id, kClientTracingId, false /* preempts */, |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); | 527 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); |
| 529 | 528 |
| 530 // Destroy the command buffers we initialized before destoying GL. | 529 // Destroy the command buffers we initialized before destoying GL. |
| 531 HandleMessage(channel, | 530 HandleMessage(channel, |
| 532 new GpuChannelMsg_DestroyCommandBuffer(kFriendlyRouteId)); | 531 new GpuChannelMsg_DestroyCommandBuffer(kFriendlyRouteId)); |
| 533 HandleMessage(channel, | 532 HandleMessage(channel, |
| 534 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); | 533 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); |
| 535 } | 534 } |
| 536 | 535 |
| 537 } // namespace gpu | 536 } // namespace gpu |
| OLD | NEW |