Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / extensions / browser / api / cast_channel / cast_test_util.cc
blob7744469f7170f8b1a30a232ae368641dba56844b
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
3 // found in the LICENSE file.
5 #include "extensions/browser/api/cast_channel/cast_test_util.h"
7 namespace extensions {
8 namespace core_api {
9 namespace cast_channel {
11 const char kTestExtensionId[] = "ddchlicdkolnonkihahngkmmmjnjlkkf";
13 MockCastTransport::MockCastTransport() {
15 MockCastTransport::~MockCastTransport() {
18 CastTransport::Delegate* MockCastTransport::current_delegate() const {
19 CHECK(delegate_);
20 return delegate_.get();
23 void MockCastTransport::SetReadDelegate(
24 scoped_ptr<CastTransport::Delegate> delegate) {
25 delegate_ = delegate.Pass();
28 MockCastTransportDelegate::MockCastTransportDelegate() {
30 MockCastTransportDelegate::~MockCastTransportDelegate() {
33 MockCastSocket::MockCastSocket()
34 : CastSocket(kTestExtensionId), mock_transport_(new MockCastTransport) {
36 MockCastSocket::~MockCastSocket() {
39 net::IPEndPoint CreateIPEndPointForTest() {
40 net::IPAddressNumber number;
41 number.push_back(192);
42 number.push_back(168);
43 number.push_back(1);
44 number.push_back(1);
45 return net::IPEndPoint(number, 8009);
48 } // namespace cast_channel
49 } // namespace core_api
50 } // namespace extensions