| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |