OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a | 5 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a |
6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| may be increased to | 6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| may be increased to |
7 // increase tolerance and reduce observed flakiness (though doing so reduces the | 7 // increase tolerance and reduce observed flakiness (though doing so reduces the |
8 // meaningfulness of the test). | 8 // meaningfulness of the test). |
9 | 9 |
10 #include "mojo/edk/system/message_pipe_dispatcher.h" | 10 #include "mojo/edk/system/message_pipe_dispatcher.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // We need to initialize |d|. | 173 // We need to initialize |d|. |
174 { | 174 { |
175 auto d_peer = MessagePipeDispatcher::Create( | 175 auto d_peer = MessagePipeDispatcher::Create( |
176 MessagePipeDispatcher::kDefaultCreateOptions); | 176 MessagePipeDispatcher::kDefaultCreateOptions); |
177 auto mp = MessagePipe::CreateLocalLocal(); | 177 auto mp = MessagePipe::CreateLocalLocal(); |
178 d->Init(mp.Clone(), 0); | 178 d->Init(mp.Clone(), 0); |
179 d_peer->Init(std::move(mp), 1); | 179 d_peer->Init(std::move(mp), 1); |
180 EXPECT_EQ(MOJO_RESULT_OK, d_peer->Close()); | 180 EXPECT_EQ(MOJO_RESULT_OK, d_peer->Close()); |
181 } | 181 } |
182 | 182 |
| 183 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::NONE)); |
183 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE)); | 184 EXPECT_TRUE(d->SupportsEntrypointClass(EntrypointClass::MESSAGE_PIPE)); |
184 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER)); | 185 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_PRODUCER)); |
185 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER)); | 186 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::DATA_PIPE_CONSUMER)); |
186 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::BUFFER)); | 187 EXPECT_FALSE(d->SupportsEntrypointClass(EntrypointClass::BUFFER)); |
187 | 188 |
188 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| | 189 // TODO(vtl): Check that it actually returns |MOJO_RESULT_INVALID_ARGUMENT| |
189 // for methods in unsupported entrypoint classes. | 190 // for methods in unsupported entrypoint classes. |
190 | 191 |
191 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); | 192 EXPECT_EQ(MOJO_RESULT_OK, d->Close()); |
192 } | 193 } |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 EXPECT_EQ(total_messages_written, total_messages_read); | 722 EXPECT_EQ(total_messages_written, total_messages_read); |
722 EXPECT_EQ(total_bytes_written, total_bytes_read); | 723 EXPECT_EQ(total_bytes_written, total_bytes_read); |
723 | 724 |
724 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close()); | 725 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close()); |
725 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close()); | 726 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close()); |
726 } | 727 } |
727 | 728 |
728 } // namespace | 729 } // namespace |
729 } // namespace system | 730 } // namespace system |
730 } // namespace mojo | 731 } // namespace mojo |
OLD | NEW |