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 <stdint.h> | 5 #include <stdint.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "mojo/edk/test/test_utils.h" | 37 #include "mojo/edk/test/test_utils.h" |
38 #include "testing/gtest/include/gtest/gtest.h" | 38 #include "testing/gtest/include/gtest/gtest.h" |
39 | 39 |
40 namespace mojo { | 40 namespace mojo { |
41 namespace system { | 41 namespace system { |
42 namespace { | 42 namespace { |
43 | 43 |
44 class RemoteMessagePipeTest : public testing::Test { | 44 class RemoteMessagePipeTest : public testing::Test { |
45 public: | 45 public: |
46 RemoteMessagePipeTest() : io_thread_(base::TestIOThread::kAutoStart) {} | 46 RemoteMessagePipeTest() : io_thread_(base::TestIOThread::kAutoStart) {} |
47 virtual ~RemoteMessagePipeTest() {} | 47 ~RemoteMessagePipeTest() override {} |
48 | 48 |
49 virtual void SetUp() override { | 49 void SetUp() override { |
50 io_thread_.PostTaskAndWait( | 50 io_thread_.PostTaskAndWait( |
51 FROM_HERE, | 51 FROM_HERE, |
52 base::Bind(&RemoteMessagePipeTest::SetUpOnIOThread, | 52 base::Bind(&RemoteMessagePipeTest::SetUpOnIOThread, |
53 base::Unretained(this))); | 53 base::Unretained(this))); |
54 } | 54 } |
55 | 55 |
56 virtual void TearDown() override { | 56 void TearDown() override { |
57 io_thread_.PostTaskAndWait( | 57 io_thread_.PostTaskAndWait( |
58 FROM_HERE, | 58 FROM_HERE, |
59 base::Bind(&RemoteMessagePipeTest::TearDownOnIOThread, | 59 base::Bind(&RemoteMessagePipeTest::TearDownOnIOThread, |
60 base::Unretained(this))); | 60 base::Unretained(this))); |
61 } | 61 } |
62 | 62 |
63 protected: | 63 protected: |
64 // This connects the two given |ChannelEndpoint|s. | 64 // This connects the two given |ChannelEndpoint|s. |
65 void ConnectChannelEndpoints(scoped_refptr<ChannelEndpoint> ep0, | 65 void ConnectChannelEndpoints(scoped_refptr<ChannelEndpoint> ep0, |
66 scoped_refptr<ChannelEndpoint> ep1) { | 66 scoped_refptr<ChannelEndpoint> ep1) { |
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 mp0->Close(0); | 1177 mp0->Close(0); |
1178 mp1->Close(1); | 1178 mp1->Close(1); |
1179 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); | 1179 EXPECT_EQ(MOJO_RESULT_OK, dispatcher->Close()); |
1180 // Note that |local_mp|'s port 0 belong to |dispatcher|, which was closed. | 1180 // Note that |local_mp|'s port 0 belong to |dispatcher|, which was closed. |
1181 local_mp->Close(1); | 1181 local_mp->Close(1); |
1182 } | 1182 } |
1183 | 1183 |
1184 } // namespace | 1184 } // namespace |
1185 } // namespace system | 1185 } // namespace system |
1186 } // namespace mojo | 1186 } // namespace mojo |
OLD | NEW |