1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_NETWORK_MOCK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_
6 #define CHROMEOS_NETWORK_MOCK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_
10 #include "base/basictypes.h"
11 #include "base/values.h"
12 #include "chromeos/chromeos_export.h"
13 #include "chromeos/network/managed_network_configuration_handler.h"
14 #include "testing/gmock/include/gmock/gmock.h"
18 class CHROMEOS_EXPORT MockManagedNetworkConfigurationHandler
19 : public ManagedNetworkConfigurationHandler
{
21 MockManagedNetworkConfigurationHandler();
22 virtual ~MockManagedNetworkConfigurationHandler();
24 // ManagedNetworkConfigurationHandler overrides
25 MOCK_METHOD1(AddObserver
, void(NetworkPolicyObserver
* observer
));
26 MOCK_METHOD1(RemoveObserver
, void(NetworkPolicyObserver
* observer
));
27 MOCK_METHOD3(GetProperties
,
28 void(const std::string
& service_path
,
29 const network_handler::DictionaryResultCallback
& callback
,
30 const network_handler::ErrorCallback
& error_callback
));
31 MOCK_METHOD4(GetManagedProperties
,
32 void(const std::string
& userhash
,
33 const std::string
& service_path
,
34 const network_handler::DictionaryResultCallback
& callback
,
35 const network_handler::ErrorCallback
& error_callback
));
38 void(const std::string
& service_path
,
39 const base::DictionaryValue
& user_settings
,
40 const base::Closure
& callback
,
41 const network_handler::ErrorCallback
& error_callback
));
44 void(const std::string
& userhash
,
45 const base::DictionaryValue
& properties
,
46 const network_handler::StringResultCallback
& callback
,
47 const network_handler::ErrorCallback
& error_callback
));
50 void(const std::string
& service_path
,
51 const base::Closure
& callback
,
52 const network_handler::ErrorCallback
& error_callback
));
53 MOCK_METHOD4(SetPolicy
,
54 void(::onc::ONCSource onc_source
,
55 const std::string
& userhash
,
56 const base::ListValue
& network_configs_onc
,
57 const base::DictionaryValue
& global_network_config
));
58 MOCK_CONST_METHOD0(IsAnyPolicyApplicationRunning
, bool());
59 MOCK_CONST_METHOD3(FindPolicyByGUID
,
60 const base::DictionaryValue
*(
61 const std::string userhash
,
62 const std::string
& guid
,
63 ::onc::ONCSource
* onc_source
));
64 MOCK_CONST_METHOD1(GetNetworkConfigsFromPolicy
,
65 const GuidToPolicyMap
*(const std::string
& userhash
));
66 MOCK_CONST_METHOD1(GetGlobalConfigFromPolicy
,
67 const base::DictionaryValue
*(const std::string
& userhash
));
69 FindPolicyByGuidAndProfile
,
70 const base::DictionaryValue
*(const std::string
& guid
,
71 const std::string
& profile_path
));
74 DISALLOW_COPY_AND_ASSIGN(MockManagedNetworkConfigurationHandler
);
77 } // namespace chromeos
79 #endif // CHROMEOS_NETWORK_MOCK_MANAGED_NETWORK_CONFIGURATION_HANDLER_H_