| 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 "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| 11 #include "mojo/edk/embedder/platform_channel_pair.h" | 11 #include "mojo/edk/embedder/platform_channel_pair.h" |
| 12 #include "mojo/edk/system/raw_channel.h" | 12 #include "mojo/edk/system/raw_channel.h" |
| 13 | 13 |
| 14 namespace mojo { | 14 namespace mojo { |
| 15 namespace system { | 15 namespace system { |
| 16 namespace test { | 16 namespace test { |
| 17 | 17 |
| 18 ChannelTestBase::ChannelTestBase() | 18 ChannelTestBase::ChannelTestBase() |
| 19 : io_thread_(mojo::test::TestIOThread::kAutoStart) {} | 19 : io_thread_(mojo::test::TestIOThread::StartMode::AUTO) {} |
| 20 | 20 |
| 21 ChannelTestBase::~ChannelTestBase() { | 21 ChannelTestBase::~ChannelTestBase() { |
| 22 } | 22 } |
| 23 | 23 |
| 24 void ChannelTestBase::SetUp() { | 24 void ChannelTestBase::SetUp() { |
| 25 PostMethodToIOThreadAndWait(FROM_HERE, &ChannelTestBase::SetUpOnIOThread); | 25 PostMethodToIOThreadAndWait(FROM_HERE, &ChannelTestBase::SetUpOnIOThread); |
| 26 } | 26 } |
| 27 | 27 |
| 28 void ChannelTestBase::CreateChannelOnIOThread(unsigned i) { | 28 void ChannelTestBase::CreateChannelOnIOThread(unsigned i) { |
| 29 CHECK_EQ(base::MessageLoop::current(), io_thread()->message_loop()); | 29 CHECK_EQ(base::MessageLoop::current(), io_thread()->message_loop()); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 CHECK_EQ(base::MessageLoop::current(), io_thread()->message_loop()); | 61 CHECK_EQ(base::MessageLoop::current(), io_thread()->message_loop()); |
| 62 | 62 |
| 63 embedder::PlatformChannelPair channel_pair; | 63 embedder::PlatformChannelPair channel_pair; |
| 64 raw_channels_[0] = RawChannel::Create(channel_pair.PassServerHandle()); | 64 raw_channels_[0] = RawChannel::Create(channel_pair.PassServerHandle()); |
| 65 raw_channels_[1] = RawChannel::Create(channel_pair.PassClientHandle()); | 65 raw_channels_[1] = RawChannel::Create(channel_pair.PassClientHandle()); |
| 66 } | 66 } |
| 67 | 67 |
| 68 } // namespace test | 68 } // namespace test |
| 69 } // namespace system | 69 } // namespace system |
| 70 } // namespace mojo | 70 } // namespace mojo |
| OLD | NEW |