| 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/test_channel_endpoint_client.h" | 5 #include "mojo/edk/system/test_channel_endpoint_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "mojo/edk/system/message_in_transit.h" | 9 #include "mojo/edk/system/message_in_transit.h" |
| 10 #include "mojo/edk/system/waitable_event.h" | 10 #include "mojo/edk/system/waitable_event.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 12 |
| 13 using mojo::util::RefPtr; |
| 14 |
| 13 namespace mojo { | 15 namespace mojo { |
| 14 namespace system { | 16 namespace system { |
| 15 namespace test { | 17 namespace test { |
| 16 | 18 |
| 17 void TestChannelEndpointClient::Init(unsigned port, | 19 void TestChannelEndpointClient::Init(unsigned port, |
| 18 RefPtr<ChannelEndpoint>&& endpoint) { | 20 RefPtr<ChannelEndpoint>&& endpoint) { |
| 19 MutexLocker locker(&mutex_); | 21 MutexLocker locker(&mutex_); |
| 20 ASSERT_EQ(0u, port_); | 22 ASSERT_EQ(0u, port_); |
| 21 ASSERT_FALSE(endpoint_); | 23 ASSERT_FALSE(endpoint_); |
| 22 port_ = port; | 24 port_ = port; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 TestChannelEndpointClient::TestChannelEndpointClient() | 74 TestChannelEndpointClient::TestChannelEndpointClient() |
| 73 : port_(0), read_event_(nullptr) {} | 75 : port_(0), read_event_(nullptr) {} |
| 74 | 76 |
| 75 TestChannelEndpointClient::~TestChannelEndpointClient() { | 77 TestChannelEndpointClient::~TestChannelEndpointClient() { |
| 76 EXPECT_FALSE(endpoint_); | 78 EXPECT_FALSE(endpoint_); |
| 77 } | 79 } |
| 78 | 80 |
| 79 } // namespace test | 81 } // namespace test |
| 80 } // namespace system | 82 } // namespace system |
| 81 } // namespace mojo | 83 } // namespace mojo |
| OLD | NEW |