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

Unified Diff: chrome/browser/chromeos/tether/fake_tether_service.h

Issue 2900903002: Create a FakeTetherService, which stubs out TetherService for development. (Closed)
Patch Set: Fix TetherService tests. Created 3 years, 7 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 | « chrome/browser/chromeos/tether/BUILD.gn ('k') | chrome/browser/chromeos/tether/fake_tether_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/tether/fake_tether_service.h
diff --git a/chrome/browser/chromeos/tether/fake_tether_service.h b/chrome/browser/chromeos/tether/fake_tether_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6285ca51dd45442548eaf7f32ddca0ad84a710a
--- /dev/null
+++ b/chrome/browser/chromeos/tether/fake_tether_service.h
@@ -0,0 +1,39 @@
+// 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 CHROME_BROWSER_CHROMEOS_TETHER_FAKE_TETHER_SERVICE_H_
+#define CHROME_BROWSER_CHROMEOS_TETHER_FAKE_TETHER_SERVICE_H_
+
+#include "chrome/browser/chromeos/tether/tether_service.h"
+
+// A stub of TetherService that provides an easy way to develop for Tether on
+// non-Chromebooks or without a Tether host. To use, see
+// chromeos::switches::kTetherStub for more details.
+class FakeTetherService : public TetherService {
+ public:
+ FakeTetherService(Profile* profile,
+ chromeos::PowerManagerClient* power_manager_client,
+ chromeos::SessionManagerClient* session_manager_client,
+ cryptauth::CryptAuthService* cryptauth_service,
+ chromeos::NetworkStateHandler* network_state_handler);
+
+ // TetherService:
+ void StartTetherIfEnabled() override;
+ void StopTether() override;
+
+ void set_num_tether_networks(int num_tether_networks) {
+ num_tether_networks_ = num_tether_networks;
+ }
+
+ protected:
+ // TetherService:
+ bool HasSyncedTetherHosts() const override;
+
+ private:
+ int num_tether_networks_ = 1;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeTetherService);
+};
+
+#endif // CHROME_BROWSER_CHROMEOS_TETHER_FAKE_TETHER_SERVICE_H_
« no previous file with comments | « chrome/browser/chromeos/tether/BUILD.gn ('k') | chrome/browser/chromeos/tether/fake_tether_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698