Chromium Code Reviews| Index: chromeos/components/tether/fake_managed_network_configuration_handler.h |
| diff --git a/chromeos/components/tether/fake_managed_network_configuration_handler.h b/chromeos/components/tether/fake_managed_network_configuration_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4e2db69d6efa4c37b195de1dd4d8a56dda28ab23 |
| --- /dev/null |
| +++ b/chromeos/components/tether/fake_managed_network_configuration_handler.h |
| @@ -0,0 +1,88 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
|
Kyle Horimoto
2017/04/17 20:34:53
Should this file be added to //chromeos/network? I
stevenjb
2017/04/18 21:03:36
+1, although we do also already have a MockMNCH, a
Ryan Hansberry
2017/04/20 20:57:57
Removed this file.
|
| +// 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_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_ |
| +#define CHROMEOS_COMPONENTS_TETHER_FAKE_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_ |
| + |
| +#include <memory> |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "chromeos/network/managed_network_configuration_handler.h" |
| +#include "chromeos/network/network_handler_callbacks.h" |
| +#include "chromeos/network/network_policy_observer.h" |
| + |
| +namespace chromeos { |
| + |
| +namespace tether { |
| + |
| +using GuidToPolicyMap = |
| + std::map<std::string, std::unique_ptr<base::DictionaryValue>>; |
| + |
| +class FakeManagedNetworkConfigurationHandler |
| + : public ManagedNetworkConfigurationHandler { |
| + public: |
| + FakeManagedNetworkConfigurationHandler(); |
| + |
| + void AddObserver(NetworkPolicyObserver* observer) override; |
| + void RemoveObserver(NetworkPolicyObserver* observer) override; |
| + |
| + void GetProperties( |
| + const std::string& userhash, |
| + const std::string& service_path, |
| + const network_handler::DictionaryResultCallback& callback, |
| + const network_handler::ErrorCallback& error_callback) override; |
| + void GetManagedProperties( |
| + const std::string& userhash, |
| + const std::string& service_path, |
| + const network_handler::DictionaryResultCallback& callback, |
| + const network_handler::ErrorCallback& error_callback) override; |
| + void SetProperties( |
| + const std::string& service_path, |
| + const base::DictionaryValue& user_settings, |
| + const base::Closure& callback, |
| + const network_handler::ErrorCallback& error_callback) override; |
| + void CreateConfiguration( |
| + const std::string& userhash, |
| + const base::DictionaryValue& properties, |
| + const network_handler::ServiceResultCallback& callback, |
| + const network_handler::ErrorCallback& error_callback) const override; |
| + void RemoveConfiguration( |
| + const std::string& service_path, |
| + const base::Closure& callback, |
| + const network_handler::ErrorCallback& error_callback) const override; |
| + void RemoveConfigurationFromCurrentProfile( |
| + const std::string& service_path, |
| + const base::Closure& callback, |
| + const network_handler::ErrorCallback& error_callback) const override; |
| + void SetPolicy(::onc::ONCSource onc_source, |
| + const std::string& userhash, |
| + const base::ListValue& network_configs_onc, |
| + const base::DictionaryValue& global_network_config) override; |
| + bool IsAnyPolicyApplicationRunning() const override; |
| + const base::DictionaryValue* FindPolicyByGUID( |
| + const std::string userhash, |
| + const std::string& guid, |
| + ::onc::ONCSource* onc_source) const override; |
| + const GuidToPolicyMap* GetNetworkConfigsFromPolicy( |
| + const std::string& userhash) const override; |
| + const base::DictionaryValue* GetGlobalConfigFromPolicy( |
| + const std::string& userhash) const override; |
| + const base::DictionaryValue* FindPolicyByGuidAndProfile( |
| + const std::string& guid, |
| + const std::string& profile_path) const override; |
| + |
| + const std::string& last_removed_configuration_path() const; |
|
Kyle Horimoto
2017/04/17 20:34:53
Inline this.
Ryan Hansberry
2017/04/20 20:57:57
Removed this file.
|
| + |
| + private: |
| + std::string last_removed_configuration_path_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FakeManagedNetworkConfigurationHandler); |
| +}; |
| + |
| +} // namespace tether |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROMEOS_COMPONENTS_TETHER_FAKE_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_ |