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