| 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 buffer API (the functions declared in | 5 // This file tests the C buffer API (the functions declared in |
| 6 // mojo/public/c/system/buffer.h). | 6 // mojo/public/c/system/buffer.h). |
| 7 | 7 |
| 8 #include "mojo/public/c/system/buffer.h" | 8 #include "mojo/public/c/system/buffer.h" |
| 9 |
| 9 #include "mojo/public/c/system/handle.h" | 10 #include "mojo/public/c/system/handle.h" |
| 10 #include "mojo/public/c/system/result.h" | 11 #include "mojo/public/c/system/result.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 const MojoHandleRights kDefaultSharedBufferHandleRights = | 16 const MojoHandleRights kDefaultSharedBufferHandleRights = |
| 16 MOJO_HANDLE_RIGHT_DUPLICATE | MOJO_HANDLE_RIGHT_TRANSFER | | 17 MOJO_HANDLE_RIGHT_DUPLICATE | MOJO_HANDLE_RIGHT_TRANSFER | |
| 17 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS | | 18 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS | |
| 18 MOJO_HANDLE_RIGHT_MAP_READABLE | MOJO_HANDLE_RIGHT_MAP_WRITABLE | | 19 MOJO_HANDLE_RIGHT_MAP_READABLE | MOJO_HANDLE_RIGHT_MAP_WRITABLE | |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 EXPECT_EQ(MOJO_RESULT_PERMISSION_DENIED, MojoDuplicateHandle(h2, &h3)); | 128 EXPECT_EQ(MOJO_RESULT_PERMISSION_DENIED, MojoDuplicateHandle(h2, &h3)); |
| 128 EXPECT_EQ(MOJO_HANDLE_INVALID, h3); | 129 EXPECT_EQ(MOJO_HANDLE_INVALID, h3); |
| 129 | 130 |
| 130 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(h1)); | 131 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(h1)); |
| 131 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(h2)); | 132 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(h2)); |
| 132 } | 133 } |
| 133 | 134 |
| 134 // TODO(vtl): Add multi-threaded tests. | 135 // TODO(vtl): Add multi-threaded tests. |
| 135 | 136 |
| 136 } // namespace | 137 } // namespace |
| OLD | NEW |