OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "gpu/command_buffer/common/buffer.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 |
| 8 namespace gpu { |
| 9 |
| 10 TEST(Buffer, SharedMemoryHandle) { |
| 11 const size_t kSize = 1024; |
| 12 std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory); |
| 13 shared_memory->CreateAndMapAnonymous(kSize); |
| 14 auto shared_memory_guid = shared_memory->handle().GetGUID(); |
| 15 scoped_refptr<Buffer> buffer = |
| 16 MakeBufferFromSharedMemory(std::move(shared_memory), kSize); |
| 17 EXPECT_EQ(buffer->backing()->shared_memory_handle().GetGUID(), |
| 18 shared_memory_guid); |
| 19 } |
| 20 |
| 21 } // namespace gpu |
OLD | NEW |