Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(957)

Side by Side Diff: gpu/ipc/service/gpu_channel_unittest.cc

Issue 1949593002: Fix gpu_ipc_service_unittests on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wrap Android-specific bits in if defined(OS_ANDROID) Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gpu/ipc/service/BUILD.gn ('k') | gpu/ipc/service/gpu_memory_buffer_factory_test_template.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 }; 63 };
64 64
65 #if defined(OS_WIN) 65 #if defined(OS_WIN)
66 const SurfaceHandle kFakeSurfaceHandle = 66 const SurfaceHandle kFakeSurfaceHandle =
67 reinterpret_cast<SurfaceHandle>(1); 67 reinterpret_cast<SurfaceHandle>(1);
68 #else 68 #else
69 const SurfaceHandle kFakeSurfaceHandle = 1; 69 const SurfaceHandle kFakeSurfaceHandle = 1;
70 #endif 70 #endif
71 71
72 TEST_F(GpuChannelTest, CreateViewCommandBufferAllowed) { 72 TEST_F(GpuChannelTest, CreateViewCommandBufferAllowed) {
73 // We need GL bindings to actually initialize command buffers.
74 gfx::SetGLGetProcAddressProc(gfx::MockGLInterface::GetGLProcAddress);
75 gfx::GLSurfaceTestSupport::InitializeOneOffWithMockBindings();
76
73 int32_t kClientId = 1; 77 int32_t kClientId = 1;
74 bool allow_view_command_buffers = true; 78 bool allow_view_command_buffers = true;
75 GpuChannel* channel = 79 GpuChannel* channel =
76 CreateChannel(kClientId, allow_view_command_buffers, false); 80 CreateChannel(kClientId, allow_view_command_buffers, false);
77 ASSERT_TRUE(channel); 81 ASSERT_TRUE(channel);
78 82
79 SurfaceHandle surface_handle = kFakeSurfaceHandle; 83 SurfaceHandle surface_handle = kFakeSurfaceHandle;
80 DCHECK_NE(surface_handle, kNullSurfaceHandle); 84 DCHECK_NE(surface_handle, kNullSurfaceHandle);
81 85
82 int32_t kRouteId = 1; 86 int32_t kRouteId = 1;
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId)); 477 EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId));
474 478
475 // Destroy the command buffer we initialized before destoying GL. 479 // Destroy the command buffer we initialized before destoying GL.
476 HandleMessage(channel, 480 HandleMessage(channel,
477 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId)); 481 new GpuChannelMsg_DestroyCommandBuffer(kSharedRouteId));
478 gfx::MockGLInterface::SetGLInterface(nullptr); 482 gfx::MockGLInterface::SetGLInterface(nullptr);
479 gfx::ClearGLBindings(); 483 gfx::ClearGLBindings();
480 } 484 }
481 485
482 } // namespace gpu 486 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/service/BUILD.gn ('k') | gpu/ipc/service/gpu_memory_buffer_factory_test_template.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698