Hook the WebThreadImplForMessageLoop up to post taks through the blink
[chromium-blink-merge.git] / components / wifi / fake_wifi_service.h
bloba25f19153ce60fcf6d9edef15c5c9bd2887d7139
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"
13 namespace wifi {
15 // Fake implementation of WiFiService used to satisfy expectations of
16 // networkingPrivateApi browser test.
17 class FakeWiFiService : public WiFiService {
18 public:
19 FakeWiFiService();
20 ~FakeWiFiService() override;
22 void Initialize(
23 scoped_refptr<base::SequencedTaskRunner> task_runner) override;
24 void UnInitialize() override;
25 void GetProperties(const std::string& network_guid,
26 base::DictionaryValue* properties,
27 std::string* error) override;
28 void GetManagedProperties(const std::string& network_guid,
29 base::DictionaryValue* managed_properties,
30 std::string* error) override;
31 void GetState(const std::string& network_guid,
32 base::DictionaryValue* properties,
33 std::string* error) override;
34 void SetProperties(const std::string& network_guid,
35 scoped_ptr<base::DictionaryValue> properties,
36 std::string* error) override;
37 void CreateNetwork(bool shared,
38 scoped_ptr<base::DictionaryValue> properties,
39 std::string* network_guid,
40 std::string* error) override;
41 void GetVisibleNetworks(const std::string& network_type,
42 base::ListValue* network_list,
43 bool include_details) override;
44 void RequestNetworkScan() override;
45 void StartConnect(const std::string& network_guid,
46 std::string* error) override;
47 void StartDisconnect(const std::string& network_guid,
48 std::string* error) override;
49 void GetKeyFromSystem(const std::string& network_guid,
50 std::string* key_data,
51 std::string* error) override;
52 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 void RequestConnectedNetworkUpdate() override;
58 private:
59 NetworkList::iterator FindNetwork(const std::string& network_guid);
61 void DisconnectAllNetworksOfType(const std::string& type);
63 void SortNetworks();
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);
77 } // namespace wifi
79 #endif // COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_