1 // Copyright 2014 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 COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_
6 #define COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "components/wifi/network_properties.h"
11 #include "components/wifi/wifi_service.h"
15 // Fake implementation of WiFiService used to satisfy expectations of
16 // networkingPrivateApi browser test.
17 class FakeWiFiService
: public WiFiService
{
20 virtual ~FakeWiFiService();
22 virtual void Initialize(
23 scoped_refptr
<base::SequencedTaskRunner
> task_runner
) OVERRIDE
;
24 virtual void UnInitialize() OVERRIDE
;
25 virtual void GetProperties(const std::string
& network_guid
,
26 base::DictionaryValue
* properties
,
27 std::string
* error
) OVERRIDE
;
28 virtual void GetManagedProperties(const std::string
& network_guid
,
29 base::DictionaryValue
* managed_properties
,
30 std::string
* error
) OVERRIDE
;
31 virtual void GetState(const std::string
& network_guid
,
32 base::DictionaryValue
* properties
,
33 std::string
* error
) OVERRIDE
;
34 virtual void SetProperties(const std::string
& network_guid
,
35 scoped_ptr
<base::DictionaryValue
> properties
,
36 std::string
* error
) OVERRIDE
;
37 virtual void CreateNetwork(bool shared
,
38 scoped_ptr
<base::DictionaryValue
> properties
,
39 std::string
* network_guid
,
40 std::string
* error
) OVERRIDE
;
41 virtual void GetVisibleNetworks(const std::string
& network_type
,
42 base::ListValue
* network_list
,
43 bool include_details
) OVERRIDE
;
44 virtual void RequestNetworkScan() OVERRIDE
;
45 virtual void StartConnect(const std::string
& network_guid
,
46 std::string
* error
) OVERRIDE
;
47 virtual void StartDisconnect(const std::string
& network_guid
,
48 std::string
* error
) OVERRIDE
;
49 virtual void GetKeyFromSystem(const std::string
& network_guid
,
50 std::string
* key_data
,
51 std::string
* error
) OVERRIDE
;
52 virtual void SetEventObservers(
53 scoped_refptr
<base::MessageLoopProxy
> message_loop_proxy
,
54 const NetworkGuidListCallback
& networks_changed_observer
,
55 const NetworkGuidListCallback
& network_list_changed_observer
) OVERRIDE
;
56 virtual void RequestConnectedNetworkUpdate() OVERRIDE
;
59 NetworkList::iterator
FindNetwork(const std::string
& network_guid
);
61 void DisconnectAllNetworksOfType(const std::string
& type
);
65 void NotifyNetworkListChanged(const NetworkList
& networks
);
67 void NotifyNetworkChanged(const std::string
& network_guid
);
69 NetworkList networks_
;
70 scoped_refptr
<base::MessageLoopProxy
> message_loop_proxy_
;
71 NetworkGuidListCallback networks_changed_observer_
;
72 NetworkGuidListCallback network_list_changed_observer_
;
74 DISALLOW_COPY_AND_ASSIGN(FakeWiFiService
);
79 #endif // COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_