| 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 #include "mojo/edk/system/raw_channel.h" | 5 #include "mojo/edk/system/raw_channel.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <stdio.h> | 8 #include <stdio.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 size_t write_size = 0; | 66 size_t write_size = 0; |
| 67 mojo::test::BlockingWrite(handle, message->main_buffer(), | 67 mojo::test::BlockingWrite(handle, message->main_buffer(), |
| 68 message->main_buffer_size(), &write_size); | 68 message->main_buffer_size(), &write_size); |
| 69 return write_size == message->main_buffer_size(); | 69 return write_size == message->main_buffer_size(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // ----------------------------------------------------------------------------- | 72 // ----------------------------------------------------------------------------- |
| 73 | 73 |
| 74 class RawChannelTest : public testing::Test { | 74 class RawChannelTest : public testing::Test { |
| 75 public: | 75 public: |
| 76 RawChannelTest() : io_thread_(mojo::test::TestIOThread::kManualStart) {} | 76 RawChannelTest() : io_thread_(mojo::test::TestIOThread::StartMode::MANUAL) {} |
| 77 ~RawChannelTest() override {} | 77 ~RawChannelTest() override {} |
| 78 | 78 |
| 79 void SetUp() override { | 79 void SetUp() override { |
| 80 embedder::PlatformChannelPair channel_pair; | 80 embedder::PlatformChannelPair channel_pair; |
| 81 handles[0] = channel_pair.PassServerHandle(); | 81 handles[0] = channel_pair.PassServerHandle(); |
| 82 handles[1] = channel_pair.PassClientHandle(); | 82 handles[1] = channel_pair.PassClientHandle(); |
| 83 io_thread_.Start(); | 83 io_thread_.Start(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void TearDown() override { | 86 void TearDown() override { |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 FROM_HERE, | 838 FROM_HERE, |
| 839 base::Bind(&RawChannel::Shutdown, base::Unretained(rc_read.get()))); | 839 base::Bind(&RawChannel::Shutdown, base::Unretained(rc_read.get()))); |
| 840 io_thread()->PostTaskAndWait( | 840 io_thread()->PostTaskAndWait( |
| 841 FROM_HERE, | 841 FROM_HERE, |
| 842 base::Bind(&RawChannel::Shutdown, base::Unretained(rc_write.get()))); | 842 base::Bind(&RawChannel::Shutdown, base::Unretained(rc_write.get()))); |
| 843 } | 843 } |
| 844 | 844 |
| 845 } // namespace | 845 } // namespace |
| 846 } // namespace system | 846 } // namespace system |
| 847 } // namespace mojo | 847 } // namespace mojo |
| OLD | NEW |