Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / remoting / test / fake_network_manager.h
blob01da153ee64c629cef8d780d93ece64c1c484c47
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 #ifndef REMOTING_TEST_FAKE_NETWORK_MANAGER_H_
6 #define REMOTING_TEST_FAKE_NETWORK_MANAGER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/weak_ptr.h"
10 #include "third_party/webrtc/base/network.h"
12 namespace remoting {
14 // FakeNetworkManager always returns one interface with the IP address
15 // specified in the constructor.
16 class FakeNetworkManager : public rtc::NetworkManager {
17 public:
18 explicit FakeNetworkManager(const rtc::IPAddress& address);
19 ~FakeNetworkManager() override;
21 // rtc::NetworkManager interface.
22 void StartUpdating() override;
23 void StopUpdating() override;
24 void GetNetworks(NetworkList* networks) const override;
26 protected:
27 void SendNetworksChangedSignal();
29 bool started_;
30 scoped_ptr<rtc::Network> network_;
32 base::WeakPtrFactory<FakeNetworkManager> weak_factory_;
35 } // namespace remoting
37 #endif // REMOTING_TEST_FAKE_NETWORK_MANAGER_H_