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

Unified Diff: chrome/browser/chromeos/tether/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
Index: chrome/browser/chromeos/tether/tether_service.h
diff --git a/chrome/browser/chromeos/tether/tether_service.h b/chrome/browser/chromeos/tether/tether_service.h
index 814f4bf1bdb88237a153f9aec1734ac4b95537a5..27f1fface5e2982cd63b40ec0f55da73fe23ea33 100644
--- a/chrome/browser/chromeos/tether/tether_service.h
+++ b/chrome/browser/chromeos/tether/tether_service.h
@@ -7,6 +7,7 @@
#include <memory>
+#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "chromeos/dbus/power_manager_client.h"
@@ -44,13 +45,17 @@ class TetherService : public KeyedService,
static void RegisterProfilePrefs(PrefRegistrySimple* registry);
+ // Whether the Tether feature has been enabled via a chrome://about or
+ // command line flag.
+ static bool IsFeatureFlagEnabled();
+
// Attempt to start the Tether module. Only succeeds if all conditions to
// reach chromeos::NetworkStateHandler::TechnologyState::ENABLED are reached.
// Should only be called once a user is logged in.
- void StartTetherIfEnabled();
+ virtual void StartTetherIfEnabled();
// Stop the Tether module.
- void StopTether();
+ virtual void StopTether();
protected:
// KeyedService:
@@ -79,25 +84,25 @@ class TetherService : public KeyedService,
// Callback when the controlling pref changes.
void OnPrefsChanged();
+ // Whether Tether hosts are available.
+ virtual bool HasSyncedTetherHosts() const;
+
virtual void UpdateTetherTechnologyState();
+ chromeos::NetworkStateHandler::TechnologyState GetTetherTechnologyState();
+
+ chromeos::NetworkStateHandler* network_state_handler() {
+ return network_state_handler_;
+ }
private:
friend class TetherServiceTest;
-
- chromeos::NetworkStateHandler::TechnologyState GetTetherTechnologyState();
+ FRIEND_TEST_ALL_PREFIXES(TetherServiceTest, TestFeatureFlagEnabled);
void OnBluetoothAdapterFetched(
scoped_refptr<device::BluetoothAdapter> adapter);
bool IsBluetoothAvailable() const;
- // Whether Tether hosts are available.
- bool HasSyncedTetherHosts() const;
-
- // Whether the Tether feature has been enabled via an about or command line
- // flag.
- bool IsFeatureFlagEnabled() const;
-
// Whether Tether is allowed to be used. If the controlling preference
// is set (from policy), this returns the preference value. Otherwise, it is
// permitted if the flag is enabled.
« no previous file with comments | « chrome/browser/chromeos/tether/fake_tether_service.cc ('k') | chrome/browser/chromeos/tether/tether_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698