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

Side by Side Diff: gpu/ipc/client/gpu_memory_buffer_impl_shared_memory_unittest.cc

Issue 2912753002: Add gfx::GpuMemoryBuffer::shared_memory_handle() (Closed)
Patch Set: Created 3 years, 6 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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 <memory> 5 #include <memory>
6 6
7 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" 7 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h"
8 #include "gpu/ipc/client/gpu_memory_buffer_impl_test_template.h" 8 #include "gpu/ipc/client/gpu_memory_buffer_impl_test_template.h"
9 9
10 namespace gpu { 10 namespace gpu {
(...skipping 14 matching lines...) Expand all
25 25
26 for (auto format : gfx::GetBufferFormatsForTesting()) { 26 for (auto format : gfx::GetBufferFormatsForTesting()) {
27 bool destroyed = false; 27 bool destroyed = false;
28 std::unique_ptr<GpuMemoryBufferImplSharedMemory> buffer( 28 std::unique_ptr<GpuMemoryBufferImplSharedMemory> buffer(
29 GpuMemoryBufferImplSharedMemory::Create( 29 GpuMemoryBufferImplSharedMemory::Create(
30 kBufferId, buffer_size, format, 30 kBufferId, buffer_size, format,
31 base::Bind(&BufferDestroyed, base::Unretained(&destroyed)))); 31 base::Bind(&BufferDestroyed, base::Unretained(&destroyed))));
32 ASSERT_TRUE(buffer); 32 ASSERT_TRUE(buffer);
33 EXPECT_EQ(buffer->GetFormat(), format); 33 EXPECT_EQ(buffer->GetFormat(), format);
34 34
35 // Check if the backend is actually SharedMemory and its GUID is available.
36 EXPECT_NE(base::UnguessableToken(),
37 buffer->shared_memory_handle().GetGUID());
38
35 // Check if destruction callback is executed when deleting the buffer. 39 // Check if destruction callback is executed when deleting the buffer.
36 buffer.reset(); 40 buffer.reset();
37 ASSERT_TRUE(destroyed); 41 ASSERT_TRUE(destroyed);
38 } 42 }
39 } 43 }
40 44
41 } // namespace 45 } // namespace
42 } // namespace gpu 46 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698