OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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++ Mojo system core wrappers. | 5 // This file tests the C++ Mojo system core wrappers. |
6 // TODO(vtl): Maybe rename "CoreCppTest" -> "CoreTest" if/when this gets | 6 // TODO(vtl): Maybe rename "CoreCppTest" -> "CoreTest" if/when this gets |
7 // compiled into a different binary from the C API tests. | 7 // compiled into a different binary from the C API tests. |
8 | 8 |
9 #include "mojo/public/cpp/system/core.h" | 9 #include "mojo/public/cpp/system/core.h" |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 101 |
102 EXPECT_EQ(kInvalidHandleValue, h.get().value()); | 102 EXPECT_EQ(kInvalidHandleValue, h.get().value()); |
103 | 103 |
104 // This should be a no-op. | 104 // This should be a no-op. |
105 Close(h.Pass()); | 105 Close(h.Pass()); |
106 | 106 |
107 // It should still be invalid. | 107 // It should still be invalid. |
108 EXPECT_EQ(kInvalidHandleValue, h.get().value()); | 108 EXPECT_EQ(kInvalidHandleValue, h.get().value()); |
109 | 109 |
110 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, | 110 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, |
111 Wait(h.get(), ~MOJO_HANDLE_SIGNAL_NONE, 1000000)); | 111 Wait(h.get(), ~MOJO_HANDLE_SIGNAL_NONE, 1000000, nullptr)); |
112 | 112 |
113 std::vector<Handle> wh; | 113 std::vector<Handle> wh; |
114 wh.push_back(h.get()); | 114 wh.push_back(h.get()); |
115 std::vector<MojoHandleSignals> sigs; | 115 std::vector<MojoHandleSignals> sigs; |
116 sigs.push_back(~MOJO_HANDLE_SIGNAL_NONE); | 116 sigs.push_back(~MOJO_HANDLE_SIGNAL_NONE); |
117 WaitManyResult wait_many_result = | 117 WaitManyResult wait_many_result = |
118 WaitMany(wh, sigs, MOJO_DEADLINE_INDEFINITE, nullptr); | 118 WaitMany(wh, sigs, MOJO_DEADLINE_INDEFINITE, nullptr); |
119 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, wait_many_result.result); | 119 EXPECT_EQ(MOJO_RESULT_INVALID_ARGUMENT, wait_many_result.result); |
120 EXPECT_TRUE(wait_many_result.IsIndexValid()); | 120 EXPECT_TRUE(wait_many_result.IsIndexValid()); |
121 EXPECT_FALSE(wait_many_result.AreSignalsStatesValid()); | 121 EXPECT_FALSE(wait_many_result.AreSignalsStatesValid()); |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 486 |
487 buffer1 = buffer1.Pass(); | 487 buffer1 = buffer1.Pass(); |
488 | 488 |
489 EXPECT_TRUE(buffer1.is_valid()); | 489 EXPECT_TRUE(buffer1.is_valid()); |
490 } | 490 } |
491 | 491 |
492 // TODO(vtl): Write data pipe tests. | 492 // TODO(vtl): Write data pipe tests. |
493 | 493 |
494 } // namespace | 494 } // namespace |
495 } // namespace mojo | 495 } // namespace mojo |
OLD | NEW |