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

Side by Side Diff: content/common/gpu/client/gpu_memory_buffer_impl_shared_memory_unittest.cc

Issue 1827123002: Move content/common/gpu/client to gpu/ipc/client (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update Created 4 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
6 #include "content/common/gpu/client/gpu_memory_buffer_impl_test_template.h"
7
8 namespace content {
9 namespace {
10
11 INSTANTIATE_TYPED_TEST_CASE_P(GpuMemoryBufferImplSharedMemory,
12 GpuMemoryBufferImplTest,
13 GpuMemoryBufferImplSharedMemory);
14
15 void BufferDestroyed(bool* destroyed, const gpu::SyncToken& sync_token) {
16 *destroyed = true;
17 }
18
19 TEST(GpuMemoryBufferImplSharedMemoryTest, Create) {
20 const gfx::GpuMemoryBufferId kBufferId(1);
21
22 gfx::Size buffer_size(8, 8);
23
24 for (auto format : gfx::GetBufferFormatsForTesting()) {
25 bool destroyed = false;
26 scoped_ptr<GpuMemoryBufferImplSharedMemory> buffer(
27 GpuMemoryBufferImplSharedMemory::Create(
28 kBufferId, buffer_size, format,
29 base::Bind(&BufferDestroyed, base::Unretained(&destroyed))));
30 ASSERT_TRUE(buffer);
31 EXPECT_EQ(buffer->GetFormat(), format);
32
33 // Check if destruction callback is executed when deleting the buffer.
34 buffer.reset();
35 ASSERT_TRUE(destroyed);
36 }
37 }
38
39 } // namespace
40 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698