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

Side by Side Diff: ui/gfx/mojo/struct_traits_unittest.cc

Issue 2415443005: gfx: Fix sending an invalid GpuMemoryBufferHandle over mojo. (Closed)
Patch Set: . Created 4 years, 2 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
« no previous file with comments | « ui/gfx/mojo/buffer_types_traits.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "base/message_loop/message_loop.h" 5 #include "base/message_loop/message_loop.h"
6 #include "mojo/public/cpp/bindings/binding_set.h" 6 #include "mojo/public/cpp/bindings/binding_set.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 #include "ui/gfx/mojo/traits_test_service.mojom.h" 8 #include "ui/gfx/mojo/traits_test_service.mojom.h"
9 #include "ui/gfx/native_widget_types.h" 9 #include "ui/gfx/native_widget_types.h"
10 #include "ui/gfx/selection_bound.h" 10 #include "ui/gfx/selection_bound.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 EXPECT_EQ(kModifier, output.native_pixmap_handle.planes.back().modifier); 178 EXPECT_EQ(kModifier, output.native_pixmap_handle.planes.back().modifier);
179 #endif 179 #endif
180 180
181 #if !defined(OS_MACOSX) && !defined(OS_IOS) 181 #if !defined(OS_MACOSX) && !defined(OS_IOS)
182 // TODO: Add support for mach_port on mac. 182 // TODO: Add support for mach_port on mac.
183 base::SharedMemory output_memory(output.handle, true); 183 base::SharedMemory output_memory(output.handle, true);
184 EXPECT_TRUE(output_memory.Map(1024)); 184 EXPECT_TRUE(output_memory.Map(1024));
185 #endif 185 #endif
186 } 186 }
187 187
188 TEST_F(StructTraitsTest, NullGpuMemoryBufferHandle) {
189 mojom::TraitsTestServicePtr proxy = GetTraitsTestProxy();
190 GpuMemoryBufferHandle output;
191 proxy->EchoGpuMemoryBufferHandle(GpuMemoryBufferHandle(), &output);
192 EXPECT_TRUE(output.is_null());
193 }
194
188 } // namespace gfx 195 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/mojo/buffer_types_traits.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698