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

Unified Diff: chromeos/components/tether/fake_active_host.h

Issue 2741253002: [CrOS Tether] Create KeepAliveScheduler, a class which schedules keep-alive tickles to be sent to a… (Closed)
Patch Set: Added tests for other modified files. Created 3 years, 9 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
Index: chromeos/components/tether/fake_active_host.h
diff --git a/chromeos/components/tether/fake_active_host.h b/chromeos/components/tether/fake_active_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..3ec912a7716f9e3f026262e58b40a0824e1e1524
--- /dev/null
+++ b/chromeos/components/tether/fake_active_host.h
@@ -0,0 +1,54 @@
+// Copyright 2017 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 CHROMEOS_COMPONENTS_TETHER_FAKE_ACTIVE_HOST_H_
+#define CHROMEOS_COMPONENTS_TETHER_FAKE_ACTIVE_HOST_H_
+
+#include <string>
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
+#include "chromeos/components/tether/active_host.h"
+
+namespace chromeos {
+
+namespace tether {
+
+// Test double for ActiveHost.
+class FakeActiveHost : public ActiveHost {
+ public:
+ FakeActiveHost();
+ ~FakeActiveHost() override;
+
+ // ActiveHost:
+ void SetActiveHostDisconnected() override;
+ void SetActiveHostConnecting(
+ const std::string& active_host_device_id) override;
+ void SetActiveHostConnected(const std::string& active_host_device_id,
+ const std::string& wifi_network_id) override;
+ void GetActiveHost(
+ const ActiveHost::ActiveHostCallback& active_host_callback) override;
+ ActiveHostStatus GetActiveHostStatus() const override;
+ std::string GetActiveHostDeviceId() const override;
+ std::string GetWifiNetworkId() const override;
+
+ private:
+ void SetActiveHost(ActiveHostStatus active_host_status,
+ const std::string& active_host_device_id,
+ const std::string& wifi_network_id);
+
+ ActiveHost::ActiveHostStatus active_host_status_;
+ std::string active_host_device_id_;
+ std::string wifi_network_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeActiveHost);
+};
+
+} // namespace tether
+
+} // namespace chromeos
+
+#endif // CHROMEOS_COMPONENTS_TETHER_FAKE_ACTIVE_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698