| 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 // This file tests the C++ wrappers in mojo/public/cpp/system/handle.h. | 5 // This file tests the C++ wrappers in mojo/public/cpp/system/handle.h. |
| 6 | 6 |
| 7 #include "mojo/public/cpp/system/handle.h" | 7 #include "mojo/public/cpp/system/handle.h" |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "gtest/gtest.h" |
| 12 #include "mojo/public/cpp/system/buffer.h" | 13 #include "mojo/public/cpp/system/buffer.h" |
| 13 #include "mojo/public/cpp/system/macros.h" | 14 #include "mojo/public/cpp/system/macros.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | |
| 15 | 15 |
| 16 namespace mojo { | 16 namespace mojo { |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 // Basic |Handle| tests. | 19 // Basic |Handle| tests. |
| 20 TEST(HandleTest, Handle) { | 20 TEST(HandleTest, Handle) { |
| 21 EXPECT_EQ(MOJO_HANDLE_INVALID, kInvalidHandleValue); | 21 EXPECT_EQ(MOJO_HANDLE_INVALID, kInvalidHandleValue); |
| 22 | 22 |
| 23 Handle h0; | 23 Handle h0; |
| 24 EXPECT_EQ(kInvalidHandleValue, h0.value()); | 24 EXPECT_EQ(kInvalidHandleValue, h0.value()); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 GetRights(buffer3.get()) & (kDuplicate | kTransfer | kGetOptions)); | 207 GetRights(buffer3.get()) & (kDuplicate | kTransfer | kGetOptions)); |
| 208 EXPECT_EQ(kDuplicate, | 208 EXPECT_EQ(kDuplicate, |
| 209 GetRights(buffer2.get()) & (kDuplicate | kTransfer | kGetOptions)); | 209 GetRights(buffer2.get()) & (kDuplicate | kTransfer | kGetOptions)); |
| 210 } | 210 } |
| 211 | 211 |
| 212 // TODO(vtl): Test |CloseRaw()|. | 212 // TODO(vtl): Test |CloseRaw()|. |
| 213 // TODO(vtl): Test |reset()| more thoroughly? | 213 // TODO(vtl): Test |reset()| more thoroughly? |
| 214 | 214 |
| 215 } // namespace mojo | 215 } // namespace mojo |
| 216 } // namespace | 216 } // namespace |
| OLD | NEW |