| 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 #include "mojo/edk/system/channel_test_base.h" | 5 #include "mojo/edk/system/channel_test_base.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "mojo/edk/embedder/platform_channel_pair.h" | 10 #include "mojo/edk/embedder/platform_channel_pair.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 CHECK(!channels_[i]); | 32 CHECK(!channels_[i]); |
| 33 channels_[i] = MakeRefCounted<Channel>(&platform_support_); | 33 channels_[i] = MakeRefCounted<Channel>(&platform_support_); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void ChannelTestBase::InitChannelOnIOThread(unsigned i) { | 36 void ChannelTestBase::InitChannelOnIOThread(unsigned i) { |
| 37 CHECK(io_thread()->IsCurrentAndRunning()); | 37 CHECK(io_thread()->IsCurrentAndRunning()); |
| 38 | 38 |
| 39 CHECK(raw_channels_[i]); | 39 CHECK(raw_channels_[i]); |
| 40 CHECK(channels_[i]); | 40 CHECK(channels_[i]); |
| 41 channels_[i]->Init(std::move(raw_channels_[i])); | 41 channels_[i]->Init(io_thread()->task_runner().Clone(), |
| 42 io_thread()->platform_handle_watcher(), |
| 43 std::move(raw_channels_[i])); |
| 42 } | 44 } |
| 43 | 45 |
| 44 void ChannelTestBase::CreateAndInitChannelOnIOThread(unsigned i) { | 46 void ChannelTestBase::CreateAndInitChannelOnIOThread(unsigned i) { |
| 45 CreateChannelOnIOThread(i); | 47 CreateChannelOnIOThread(i); |
| 46 InitChannelOnIOThread(i); | 48 InitChannelOnIOThread(i); |
| 47 } | 49 } |
| 48 | 50 |
| 49 void ChannelTestBase::ShutdownChannelOnIOThread(unsigned i) { | 51 void ChannelTestBase::ShutdownChannelOnIOThread(unsigned i) { |
| 50 CHECK(io_thread()->IsCurrentAndRunning()); | 52 CHECK(io_thread()->IsCurrentAndRunning()); |
| 51 | 53 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 CHECK(io_thread()->IsCurrentAndRunning()); | 64 CHECK(io_thread()->IsCurrentAndRunning()); |
| 63 | 65 |
| 64 embedder::PlatformChannelPair channel_pair; | 66 embedder::PlatformChannelPair channel_pair; |
| 65 raw_channels_[0] = RawChannel::Create(channel_pair.PassServerHandle()); | 67 raw_channels_[0] = RawChannel::Create(channel_pair.PassServerHandle()); |
| 66 raw_channels_[1] = RawChannel::Create(channel_pair.PassClientHandle()); | 68 raw_channels_[1] = RawChannel::Create(channel_pair.PassClientHandle()); |
| 67 } | 69 } |
| 68 | 70 |
| 69 } // namespace test | 71 } // namespace test |
| 70 } // namespace system | 72 } // namespace system |
| 71 } // namespace mojo | 73 } // namespace mojo |
| OLD | NEW |