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

Unified Diff: gpu/command_buffer/common/buffer_unittest.cc

Issue 2909003002: Add gpu::BufferBacking::shared_memory_handle() (Closed)
Patch Set: Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/common/buffer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/buffer_unittest.cc
diff --git a/gpu/command_buffer/common/buffer_unittest.cc b/gpu/command_buffer/common/buffer_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..89e33c09765010ae966841bb1a34a1a266e13c03
--- /dev/null
+++ b/gpu/command_buffer/common/buffer_unittest.cc
@@ -0,0 +1,21 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/command_buffer/common/buffer.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace gpu {
+
+TEST(Buffer, SharedMemoryHandle) {
+ const size_t kSize = 1024;
+ std::unique_ptr<base::SharedMemory> shared_memory(new base::SharedMemory);
+ shared_memory->CreateAndMapAnonymous(kSize);
+ auto shared_memory_guid = shared_memory->handle().GetGUID();
+ scoped_refptr<Buffer> buffer =
+ MakeBufferFromSharedMemory(std::move(shared_memory), kSize);
+ EXPECT_EQ(buffer->backing()->shared_memory_handle().GetGUID(),
+ shared_memory_guid);
+}
+
+} // namespace gpu
« no previous file with comments | « gpu/command_buffer/common/buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698