Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: components/cast_channel/cast_test_util.cc

Issue 2942993003: [cast_channel] Make CastMessageHandler a CastSocket::Observer instead of CastTransport::Delegate (Closed)
Patch Set: resolve code review comments from Mark Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/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 cast_channel { 11 namespace cast_channel {
12 12
13 MockCastTransport::MockCastTransport() {} 13 MockCastTransport::MockCastTransport() {}
14 MockCastTransport::~MockCastTransport() {} 14 MockCastTransport::~MockCastTransport() {}
15 15
16 CastTransport::Delegate* MockCastTransport::current_delegate() const { 16 CastTransport::Delegate* MockCastTransport::current_delegate() const {
17 CHECK(delegate_); 17 CHECK(delegate_);
18 return delegate_.get(); 18 return delegate_.get();
19 } 19 }
20 20
21 void MockCastTransport::SetReadDelegate( 21 void MockCastTransport::SetReadDelegate(
22 std::unique_ptr<CastTransport::Delegate> delegate) { 22 std::unique_ptr<CastTransport::Delegate> delegate) {
23 delegate_ = std::move(delegate); 23 delegate_ = std::move(delegate);
24 } 24 }
25 25
26 MockCastTransportDelegate::MockCastTransportDelegate() {} 26 MockCastTransportDelegate::MockCastTransportDelegate() {}
27 MockCastTransportDelegate::~MockCastTransportDelegate() {} 27 MockCastTransportDelegate::~MockCastTransportDelegate() {}
28 28
29 MockCastSocketObserver::MockCastSocketObserver() {}
30 MockCastSocketObserver::~MockCastSocketObserver() {}
31
29 MockCastSocket::MockCastSocket() : mock_transport_(new MockCastTransport()) {} 32 MockCastSocket::MockCastSocket() : mock_transport_(new MockCastTransport()) {}
30 MockCastSocket::~MockCastSocket() {} 33 MockCastSocket::~MockCastSocket() {}
31 34
32 net::IPEndPoint CreateIPEndPointForTest() { 35 net::IPEndPoint CreateIPEndPointForTest() {
33 return net::IPEndPoint(net::IPAddress(192, 168, 1, 1), 8009); 36 return net::IPEndPoint(net::IPAddress(192, 168, 1, 1), 8009);
34 } 37 }
35 38
36 } // namespace cast_channel 39 } // namespace cast_channel
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698