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 "remoting/test/fake_network_manager.h"
8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h"
10 #include "jingle/glue/utils.h"
11 #include "third_party/webrtc/base/socketaddress.h"
15 FakeNetworkManager::FakeNetworkManager(const rtc::IPAddress
& address
)
18 network_
.reset(new rtc::Network("fake", "Fake Network", address
, 32));
19 network_
->AddIP(address
);
22 FakeNetworkManager::~FakeNetworkManager() {
25 void FakeNetworkManager::StartUpdating() {
27 base::MessageLoop::current()->PostTask(
29 base::Bind(&FakeNetworkManager::SendNetworksChangedSignal
,
30 weak_factory_
.GetWeakPtr()));
33 void FakeNetworkManager::StopUpdating() {
37 void FakeNetworkManager::GetNetworks(NetworkList
* networks
) const {
39 networks
->push_back(network_
.get());
42 void FakeNetworkManager::SendNetworksChangedSignal() {
43 SignalNetworksChanged();
46 } // namespace remoting