Roll src/third_party/WebKit a3b4a2e:7441784 (svn 202551:202552)
[chromium-blink-merge.git] / extensions / browser / api / cast_channel / cast_test_util.cc
blobc21e051563e558cee40a58bcff2c8fe323ff2e81
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 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 api
50 } // namespace extensions