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

Unified Diff: ui/gfx/mojo/struct_traits_unittest.cc

Issue 2272153002: Add ClientNativePixmap multi-planar support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client-native-pixmap-dmabug-multiple-planes
Patch Set: ifdef USE_OZONE for unused variables. Created 4 years, 3 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 | « ui/gfx/mojo/buffer_types_traits.h ('k') | ui/gfx/native_pixmap_handle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mojo/struct_traits_unittest.cc
diff --git a/ui/gfx/mojo/struct_traits_unittest.cc b/ui/gfx/mojo/struct_traits_unittest.cc
index 556954b0f546648346f3b4d9ad312af65ac4155f..d837cd82da0c3b436638acd228994b71a9fa2eb1 100644
--- a/ui/gfx/mojo/struct_traits_unittest.cc
+++ b/ui/gfx/mojo/struct_traits_unittest.cc
@@ -144,6 +144,10 @@ TEST_F(StructTraitsTest, GpuMemoryBufferHandle) {
const gfx::GpuMemoryBufferId kId(99);
const uint32_t kOffset = 126;
const int32_t kStride = 256;
+#if defined(USE_OZONE)
+ const uint64_t kSize = kOffset + kStride;
+ const uint64_t kModifier = 2;
+#endif
base::SharedMemory shared_memory;
ASSERT_TRUE(shared_memory.CreateAnonymous(1024));
ASSERT_TRUE(shared_memory.Map(1024));
@@ -155,6 +159,11 @@ TEST_F(StructTraitsTest, GpuMemoryBufferHandle) {
handle.offset = kOffset;
handle.stride = kStride;
+#if defined(USE_OZONE)
+ handle.native_pixmap_handle.planes.emplace_back(kOffset, kStride, kSize,
+ kModifier);
+#endif
+
mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
gfx::GpuMemoryBufferHandle output;
proxy->EchoGpuMemoryBufferHandle(handle, &output);
@@ -162,6 +171,13 @@ TEST_F(StructTraitsTest, GpuMemoryBufferHandle) {
EXPECT_EQ(kId, output.id);
EXPECT_EQ(kOffset, output.offset);
EXPECT_EQ(kStride, output.stride);
+
+#if defined(USE_OZONE)
+ ASSERT_EQ(1u, output.native_pixmap_handle.planes.size());
+ EXPECT_EQ(kSize, output.native_pixmap_handle.planes.back().size);
+ EXPECT_EQ(kModifier, output.native_pixmap_handle.planes.back().modifier);
+#endif
+
#if !defined(OS_MACOSX) && !defined(OS_IOS)
// TODO: Add support for mach_port on mac.
base::SharedMemory output_memory(output.handle, true);
« no previous file with comments | « ui/gfx/mojo/buffer_types_traits.h ('k') | ui/gfx/native_pixmap_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698