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

Unified Diff: remoting/test/fake_network_manager.h

Issue 427613005: Implement network performance simulation for remoting perf tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/test/fake_network_dispatcher.cc ('k') | remoting/test/fake_network_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/fake_network_manager.h
diff --git a/remoting/test/fake_network_manager.h b/remoting/test/fake_network_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..20788b51a63ef334ca5f30f49880d8c947a1bc5f
--- /dev/null
+++ b/remoting/test/fake_network_manager.h
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_TEST_FAKE_NETWORK_MANAGER_H_
+#define REMOTING_TEST_FAKE_NETWORK_MANAGER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "third_party/webrtc/base/network.h"
+
+namespace remoting {
+
+// FakeNetworkManager always returns one interface with the IP address
+// specified in the constructor.
+class FakeNetworkManager : public rtc::NetworkManager {
+ public:
+ FakeNetworkManager(const rtc::IPAddress& address);
+ virtual ~FakeNetworkManager();
+
+ // rtc::NetworkManager interface.
+ virtual void StartUpdating() OVERRIDE;
+ virtual void StopUpdating() OVERRIDE;
+ virtual void GetNetworks(NetworkList* networks) const OVERRIDE;
+
+ protected:
+ void SendNetworksChangedSignal();
+
+ bool started_;
+ scoped_ptr<rtc::Network> network_;
+
+ base::WeakPtrFactory<FakeNetworkManager> weak_factory_;
+};
+
+} // namespace remoting
+
+#endif // REMOTING_TEST_FAKE_NETWORK_MANAGER_H_
« no previous file with comments | « remoting/test/fake_network_dispatcher.cc ('k') | remoting/test/fake_network_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698