| 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 "extensions/browser/api/cast_channel/cast_test_util.h" | 5 #include "components/cast_channel/cast_test_util.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "net/base/ip_address.h" | 9 #include "net/base/ip_address.h" |
| 10 | 10 |
| 11 namespace extensions { | |
| 12 namespace api { | |
| 13 namespace cast_channel { | 11 namespace cast_channel { |
| 14 | 12 |
| 15 const char kTestExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf"; | 13 MockCastTransport::MockCastTransport() {} |
| 16 | 14 MockCastTransport::~MockCastTransport() {} |
| 17 MockCastTransport::MockCastTransport() { | |
| 18 } | |
| 19 MockCastTransport::~MockCastTransport() { | |
| 20 } | |
| 21 | 15 |
| 22 CastTransport::Delegate* MockCastTransport::current_delegate() const { | 16 CastTransport::Delegate* MockCastTransport::current_delegate() const { |
| 23 CHECK(delegate_); | 17 CHECK(delegate_); |
| 24 return delegate_.get(); | 18 return delegate_.get(); |
| 25 } | 19 } |
| 26 | 20 |
| 27 void MockCastTransport::SetReadDelegate( | 21 void MockCastTransport::SetReadDelegate( |
| 28 std::unique_ptr<CastTransport::Delegate> delegate) { | 22 std::unique_ptr<CastTransport::Delegate> delegate) { |
| 29 delegate_ = std::move(delegate); | 23 delegate_ = std::move(delegate); |
| 30 } | 24 } |
| 31 | 25 |
| 32 MockCastTransportDelegate::MockCastTransportDelegate() { | 26 MockCastTransportDelegate::MockCastTransportDelegate() {} |
| 33 } | 27 MockCastTransportDelegate::~MockCastTransportDelegate() {} |
| 34 MockCastTransportDelegate::~MockCastTransportDelegate() { | |
| 35 } | |
| 36 | 28 |
| 37 MockCastSocket::MockCastSocket() : mock_transport_(new MockCastTransport()) {} | 29 MockCastSocket::MockCastSocket() : mock_transport_(new MockCastTransport()) {} |
| 38 MockCastSocket::~MockCastSocket() { | 30 MockCastSocket::~MockCastSocket() {} |
| 39 } | |
| 40 | 31 |
| 41 net::IPEndPoint CreateIPEndPointForTest() { | 32 net::IPEndPoint CreateIPEndPointForTest() { |
| 42 return net::IPEndPoint(net::IPAddress(192, 168, 1, 1), 8009); | 33 return net::IPEndPoint(net::IPAddress(192, 168, 1, 1), 8009); |
| 43 } | 34 } |
| 44 | 35 |
| 45 } // namespace cast_channel | 36 } // namespace cast_channel |
| 46 } // namespace api | |
| 47 } // namespace extensions | |
| OLD | NEW |