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 data pipe API (the functions declared in | 5 // This file tests the C data pipe API (the functions declared in |
6 // mojo/public/c/include/mojo/system/data_pipe.h). | 6 // mojo/public/c/include/mojo/system/data_pipe.h). |
7 | 7 |
8 #include <mojo/system/data_pipe.h> | 8 #include <mojo/system/data_pipe.h> |
9 | 9 |
10 #include <mojo/result.h> | 10 #include <mojo/result.h> |
11 #include <mojo/system/handle.h> | 11 #include <mojo/system/handle.h> |
12 #include <mojo/system/wait.h> | 12 #include <mojo/system/wait.h> |
13 #include <string.h> | 13 #include <string.h> |
14 | 14 |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "gtest/gtest.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 const MojoHandleRights kDefaultDataPipeProducerHandleRights = | 19 const MojoHandleRights kDefaultDataPipeProducerHandleRights = |
20 MOJO_HANDLE_RIGHT_TRANSFER | MOJO_HANDLE_RIGHT_WRITE | | 20 MOJO_HANDLE_RIGHT_TRANSFER | MOJO_HANDLE_RIGHT_WRITE | |
21 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS; | 21 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS; |
22 const MojoHandleRights kDefaultDataPipeConsumerHandleRights = | 22 const MojoHandleRights kDefaultDataPipeConsumerHandleRights = |
23 MOJO_HANDLE_RIGHT_TRANSFER | MOJO_HANDLE_RIGHT_READ | | 23 MOJO_HANDLE_RIGHT_TRANSFER | MOJO_HANDLE_RIGHT_READ | |
24 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS; | 24 MOJO_HANDLE_RIGHT_GET_OPTIONS | MOJO_HANDLE_RIGHT_SET_OPTIONS; |
25 | 25 |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 EXPECT_EQ(MOJO_RESULT_OK, | 435 EXPECT_EQ(MOJO_RESULT_OK, |
436 MojoWait(hc, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, nullptr)); | 436 MojoWait(hc, MOJO_HANDLE_SIGNAL_READ_THRESHOLD, 0, nullptr)); |
437 | 437 |
438 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hp)); | 438 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hp)); |
439 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hc)); | 439 EXPECT_EQ(MOJO_RESULT_OK, MojoClose(hc)); |
440 } | 440 } |
441 | 441 |
442 // TODO(vtl): Add multi-threaded tests. | 442 // TODO(vtl): Add multi-threaded tests. |
443 | 443 |
444 } // namespace | 444 } // namespace |
OLD | NEW |