| 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" |
| 11 | 11 |
| 12 #include <string.h> | 12 #include <string.h> |
| 13 | 13 |
| 14 #include <limits> | 14 #include <limits> |
| 15 #include <memory> | 15 #include <memory> |
| 16 #include <utility> | 16 #include <utility> |
| 17 #include <vector> | 17 #include <vector> |
| 18 | 18 |
| 19 #include "mojo/edk/system/message_pipe.h" | 19 #include "mojo/edk/system/message_pipe.h" |
| 20 #include "mojo/edk/system/ref_ptr.h" | |
| 21 #include "mojo/edk/system/test/random.h" | 20 #include "mojo/edk/system/test/random.h" |
| 22 #include "mojo/edk/system/test/simple_test_thread.h" | 21 #include "mojo/edk/system/test/simple_test_thread.h" |
| 23 #include "mojo/edk/system/test/sleep.h" | 22 #include "mojo/edk/system/test/sleep.h" |
| 24 #include "mojo/edk/system/test/stopwatch.h" | 23 #include "mojo/edk/system/test/stopwatch.h" |
| 25 #include "mojo/edk/system/test/timeouts.h" | 24 #include "mojo/edk/system/test/timeouts.h" |
| 26 #include "mojo/edk/system/waiter.h" | 25 #include "mojo/edk/system/waiter.h" |
| 27 #include "mojo/edk/system/waiter_test_utils.h" | 26 #include "mojo/edk/system/waiter_test_utils.h" |
| 28 #include "mojo/edk/util/make_unique.h" | 27 #include "mojo/edk/util/make_unique.h" |
| 28 #include "mojo/edk/util/ref_ptr.h" |
| 29 #include "mojo/public/cpp/system/macros.h" | 29 #include "mojo/public/cpp/system/macros.h" |
| 30 #include "testing/gtest/include/gtest/gtest.h" | 30 #include "testing/gtest/include/gtest/gtest.h" |
| 31 | 31 |
| 32 using mojo::util::RefPtr; |
| 33 |
| 32 namespace mojo { | 34 namespace mojo { |
| 33 namespace system { | 35 namespace system { |
| 34 namespace { | 36 namespace { |
| 35 | 37 |
| 36 const MojoHandleSignals kAllSignals = MOJO_HANDLE_SIGNAL_READABLE | | 38 const MojoHandleSignals kAllSignals = MOJO_HANDLE_SIGNAL_READABLE | |
| 37 MOJO_HANDLE_SIGNAL_WRITABLE | | 39 MOJO_HANDLE_SIGNAL_WRITABLE | |
| 38 MOJO_HANDLE_SIGNAL_PEER_CLOSED; | 40 MOJO_HANDLE_SIGNAL_PEER_CLOSED; |
| 39 | 41 |
| 40 TEST(MessagePipeDispatcherTest, Basic) { | 42 TEST(MessagePipeDispatcherTest, Basic) { |
| 41 test::Stopwatch stopwatch; | 43 test::Stopwatch stopwatch; |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 EXPECT_EQ(total_messages_written, total_messages_read); | 680 EXPECT_EQ(total_messages_written, total_messages_read); |
| 679 EXPECT_EQ(total_bytes_written, total_bytes_read); | 681 EXPECT_EQ(total_bytes_written, total_bytes_read); |
| 680 | 682 |
| 681 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close()); | 683 EXPECT_EQ(MOJO_RESULT_OK, d_write->Close()); |
| 682 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close()); | 684 EXPECT_EQ(MOJO_RESULT_OK, d_read->Close()); |
| 683 } | 685 } |
| 684 | 686 |
| 685 } // namespace | 687 } // namespace |
| 686 } // namespace system | 688 } // namespace system |
| 687 } // namespace mojo | 689 } // namespace mojo |
| OLD | NEW |