Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: mojo/edk/system/channel_test_base.h

Issue 1423713009: EDK: Move ref counting classes to mojo/edk/util. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/edk/system/channel_manager_unittest.cc ('k') | mojo/edk/system/channel_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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> 8 #include <memory>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "mojo/edk/embedder/simple_platform_support.h" 11 #include "mojo/edk/embedder/simple_platform_support.h"
12 #include "mojo/edk/system/channel.h" 12 #include "mojo/edk/system/channel.h"
13 #include "mojo/edk/system/ref_ptr.h"
14 #include "mojo/edk/system/test/test_io_thread.h" 13 #include "mojo/edk/system/test/test_io_thread.h"
14 #include "mojo/edk/util/ref_ptr.h"
15 #include "mojo/public/cpp/system/macros.h" 15 #include "mojo/public/cpp/system/macros.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 namespace mojo { 18 namespace mojo {
19 namespace system { 19 namespace system {
20 20
21 class RawChannel; 21 class RawChannel;
22 22
23 namespace test { 23 namespace test {
24 24
(...skipping 13 matching lines...) Expand all
38 38
39 // These should only be called from |io_thread()|: 39 // These should only be called from |io_thread()|:
40 void CreateChannelOnIOThread(unsigned i); 40 void CreateChannelOnIOThread(unsigned i);
41 void InitChannelOnIOThread(unsigned i); 41 void InitChannelOnIOThread(unsigned i);
42 void CreateAndInitChannelOnIOThread(unsigned i); 42 void CreateAndInitChannelOnIOThread(unsigned i);
43 void ShutdownChannelOnIOThread(unsigned i); 43 void ShutdownChannelOnIOThread(unsigned i);
44 void ShutdownAndReleaseChannelOnIOThread(unsigned i); 44 void ShutdownAndReleaseChannelOnIOThread(unsigned i);
45 45
46 TestIOThread* io_thread() { return &io_thread_; } 46 TestIOThread* io_thread() { return &io_thread_; }
47 Channel* channel(unsigned i) { return channels_[i].get(); } 47 Channel* channel(unsigned i) { return channels_[i].get(); }
48 RefPtr<Channel>* mutable_channel(unsigned i) { return &channels_[i]; } 48 util::RefPtr<Channel>* mutable_channel(unsigned i) { return &channels_[i]; }
49 49
50 private: 50 private:
51 void SetUpOnIOThread(); 51 void SetUpOnIOThread();
52 52
53 embedder::SimplePlatformSupport platform_support_; 53 embedder::SimplePlatformSupport platform_support_;
54 TestIOThread io_thread_; 54 TestIOThread io_thread_;
55 std::unique_ptr<RawChannel> raw_channels_[2]; 55 std::unique_ptr<RawChannel> raw_channels_[2];
56 RefPtr<Channel> channels_[2]; 56 util::RefPtr<Channel> channels_[2];
57 57
58 MOJO_DISALLOW_COPY_AND_ASSIGN(ChannelTestBase); 58 MOJO_DISALLOW_COPY_AND_ASSIGN(ChannelTestBase);
59 }; 59 };
60 60
61 } // namespace test 61 } // namespace test
62 } // namespace system 62 } // namespace system
63 } // namespace mojo 63 } // namespace mojo
64 64
65 #endif // MOJO_EDK_SYSTEM_CHANNEL_TEST_BASE_H_ 65 #endif // MOJO_EDK_SYSTEM_CHANNEL_TEST_BASE_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/channel_manager_unittest.cc ('k') | mojo/edk/system/channel_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698