| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 contains tests that are shared between different implementations of | 5 // This file contains tests that are shared between different implementations of |
| 6 // |DataPipeImpl|. | 6 // |DataPipeImpl|. |
| 7 | 7 |
| 8 #include "mojo/edk/system/data_pipe_impl.h" | 8 #include "mojo/edk/system/data_pipe_impl.h" |
| 9 | 9 |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 | 11 |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <utility> | 13 #include <utility> |
| 14 | 14 |
| 15 #include "base/bind.h" | 15 #include "base/bind.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
| 18 #include "mojo/edk/embedder/platform_channel_pair.h" | 18 #include "mojo/edk/embedder/platform_channel_pair.h" |
| 19 #include "mojo/edk/embedder/simple_platform_support.h" | 19 #include "mojo/edk/embedder/simple_platform_support.h" |
| 20 #include "mojo/edk/system/channel.h" | 20 #include "mojo/edk/system/channel.h" |
| 21 #include "mojo/edk/system/channel_endpoint.h" | 21 #include "mojo/edk/system/channel_endpoint.h" |
| 22 #include "mojo/edk/system/data_pipe.h" | 22 #include "mojo/edk/system/data_pipe.h" |
| 23 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h" | 23 #include "mojo/edk/system/data_pipe_consumer_dispatcher.h" |
| 24 #include "mojo/edk/system/data_pipe_producer_dispatcher.h" | 24 #include "mojo/edk/system/data_pipe_producer_dispatcher.h" |
| 25 #include "mojo/edk/system/memory.h" | 25 #include "mojo/edk/system/memory.h" |
| 26 #include "mojo/edk/system/message_pipe.h" | 26 #include "mojo/edk/system/message_pipe.h" |
| 27 #include "mojo/edk/system/raw_channel.h" | 27 #include "mojo/edk/system/raw_channel.h" |
| 28 #include "mojo/edk/system/ref_ptr.h" | |
| 29 #include "mojo/edk/system/test/sleep.h" | 28 #include "mojo/edk/system/test/sleep.h" |
| 30 #include "mojo/edk/system/test/test_io_thread.h" | 29 #include "mojo/edk/system/test/test_io_thread.h" |
| 31 #include "mojo/edk/system/test/timeouts.h" | 30 #include "mojo/edk/system/test/timeouts.h" |
| 32 #include "mojo/edk/system/waiter.h" | 31 #include "mojo/edk/system/waiter.h" |
| 32 #include "mojo/edk/util/ref_ptr.h" |
| 33 #include "mojo/public/cpp/system/macros.h" | 33 #include "mojo/public/cpp/system/macros.h" |
| 34 #include "testing/gtest/include/gtest/gtest.h" | 34 #include "testing/gtest/include/gtest/gtest.h" |
| 35 | 35 |
| 36 using mojo::util::MakeRefCounted; |
| 37 using mojo::util::RefPtr; |
| 38 |
| 36 namespace mojo { | 39 namespace mojo { |
| 37 namespace system { | 40 namespace system { |
| 38 namespace { | 41 namespace { |
| 39 | 42 |
| 40 const MojoHandleSignals kAllSignals = MOJO_HANDLE_SIGNAL_READABLE | | 43 const MojoHandleSignals kAllSignals = MOJO_HANDLE_SIGNAL_READABLE | |
| 41 MOJO_HANDLE_SIGNAL_WRITABLE | | 44 MOJO_HANDLE_SIGNAL_WRITABLE | |
| 42 MOJO_HANDLE_SIGNAL_PEER_CLOSED; | 45 MOJO_HANDLE_SIGNAL_PEER_CLOSED; |
| 43 const uint32_t kSizeOfOptions = | 46 const uint32_t kSizeOfOptions = |
| 44 static_cast<uint32_t>(sizeof(MojoCreateDataPipeOptions)); | 47 static_cast<uint32_t>(sizeof(MojoCreateDataPipeOptions)); |
| 45 | 48 |
| (...skipping 2446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 test::Sleep(10u); | 2495 test::Sleep(10u); |
| 2493 | 2496 |
| 2494 EXPECT_EQ(MOJO_RESULT_OK, this->ConsumerEndReadData(num_bytes)); | 2497 EXPECT_EQ(MOJO_RESULT_OK, this->ConsumerEndReadData(num_bytes)); |
| 2495 | 2498 |
| 2496 this->ConsumerClose(); | 2499 this->ConsumerClose(); |
| 2497 } | 2500 } |
| 2498 | 2501 |
| 2499 } // namespace | 2502 } // namespace |
| 2500 } // namespace system | 2503 } // namespace system |
| 2501 } // namespace mojo | 2504 } // namespace mojo |
| OLD | NEW |