| 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 #ifndef MOJO_EDK_SYSTEM_CHANNEL_TEST_BASE_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CHANNEL_TEST_BASE_H_ |
| 6 #define MOJO_EDK_SYSTEM_CHANNEL_TEST_BASE_H_ | 6 #define MOJO_EDK_SYSTEM_CHANNEL_TEST_BASE_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/bind.h" | 10 #include "base/bind.h" |
| 9 #include "base/location.h" | 11 #include "base/location.h" |
| 10 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "mojo/edk/embedder/simple_platform_support.h" | 13 #include "mojo/edk/embedder/simple_platform_support.h" |
| 13 #include "mojo/edk/system/channel.h" | 14 #include "mojo/edk/system/channel.h" |
| 14 #include "mojo/edk/test/test_io_thread.h" | 15 #include "mojo/edk/test/test_io_thread.h" |
| 15 #include "mojo/public/cpp/system/macros.h" | 16 #include "mojo/public/cpp/system/macros.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 18 |
| 18 namespace mojo { | 19 namespace mojo { |
| 19 namespace system { | 20 namespace system { |
| 20 | 21 |
| 21 class RawChannel; | 22 class RawChannel; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 47 | 48 |
| 48 mojo::test::TestIOThread* io_thread() { return &io_thread_; } | 49 mojo::test::TestIOThread* io_thread() { return &io_thread_; } |
| 49 Channel* channel(unsigned i) { return channels_[i].get(); } | 50 Channel* channel(unsigned i) { return channels_[i].get(); } |
| 50 scoped_refptr<Channel>* mutable_channel(unsigned i) { return &channels_[i]; } | 51 scoped_refptr<Channel>* mutable_channel(unsigned i) { return &channels_[i]; } |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 void SetUpOnIOThread(); | 54 void SetUpOnIOThread(); |
| 54 | 55 |
| 55 embedder::SimplePlatformSupport platform_support_; | 56 embedder::SimplePlatformSupport platform_support_; |
| 56 mojo::test::TestIOThread io_thread_; | 57 mojo::test::TestIOThread io_thread_; |
| 57 scoped_ptr<RawChannel> raw_channels_[2]; | 58 std::unique_ptr<RawChannel> raw_channels_[2]; |
| 58 scoped_refptr<Channel> channels_[2]; | 59 scoped_refptr<Channel> channels_[2]; |
| 59 | 60 |
| 60 MOJO_DISALLOW_COPY_AND_ASSIGN(ChannelTestBase); | 61 MOJO_DISALLOW_COPY_AND_ASSIGN(ChannelTestBase); |
| 61 }; | 62 }; |
| 62 | 63 |
| 63 } // namespace test | 64 } // namespace test |
| 64 } // namespace system | 65 } // namespace system |
| 65 } // namespace mojo | 66 } // namespace mojo |
| 66 | 67 |
| 67 #endif // MOJO_EDK_SYSTEM_CHANNEL_TEST_BASE_H_ | 68 #endif // MOJO_EDK_SYSTEM_CHANNEL_TEST_BASE_H_ |
| OLD | NEW |