Make sure webrtc::VideoSource is released when WebRtcVideoTrackAdapter is destroyed.
[chromium-blink-merge.git] / components / wifi / fake_wifi_service.h
blobfba1f522fe2a6f2316bd7b33a5f42f8457006551
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/wifi_service.h"
12 namespace wifi {
14 // Fake implementation of WiFiService used to satisfy expectations of
15 // networkingPrivateApi browser test.
16 class FakeWiFiService : public WiFiService {
17 public:
18 FakeWiFiService();
19 virtual ~FakeWiFiService();
21 virtual void Initialize(
22 scoped_refptr<base::SequencedTaskRunner> task_runner) OVERRIDE;
23 virtual void UnInitialize() OVERRIDE;
24 virtual void GetProperties(const std::string& network_guid,
25 base::DictionaryValue* properties,
26 std::string* error) OVERRIDE;
27 virtual void GetManagedProperties(const std::string& network_guid,
28 base::DictionaryValue* managed_properties,
29 std::string* error) OVERRIDE;
30 virtual void GetState(const std::string& network_guid,
31 base::DictionaryValue* properties,
32 std::string* error) OVERRIDE;
33 virtual void SetProperties(const std::string& network_guid,
34 scoped_ptr<base::DictionaryValue> properties,
35 std::string* error) OVERRIDE;
36 virtual void CreateNetwork(bool shared,
37 scoped_ptr<base::DictionaryValue> properties,
38 std::string* network_guid,
39 std::string* error) OVERRIDE;
40 virtual void GetVisibleNetworks(const std::string& network_type,
41 base::ListValue* network_list) OVERRIDE;
42 virtual void RequestNetworkScan() OVERRIDE;
43 virtual void StartConnect(const std::string& network_guid,
44 std::string* error) OVERRIDE;
45 virtual void StartDisconnect(const std::string& network_guid,
46 std::string* error) OVERRIDE;
47 virtual void GetKeyFromSystem(const std::string& network_guid,
48 std::string* key_data,
49 std::string* error) OVERRIDE;
50 virtual void SetEventObservers(
51 scoped_refptr<base::MessageLoopProxy> message_loop_proxy,
52 const NetworkGuidListCallback& networks_changed_observer,
53 const NetworkGuidListCallback& network_list_changed_observer) OVERRIDE;
54 virtual void RequestConnectedNetworkUpdate() OVERRIDE;
56 private:
57 NetworkList::iterator FindNetwork(const std::string& network_guid);
59 void DisconnectAllNetworksOfType(const std::string& type);
61 void SortNetworks();
63 void NotifyNetworkListChanged(const NetworkList& networks);
65 void NotifyNetworkChanged(const std::string& network_guid);
67 NetworkList networks_;
68 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
69 NetworkGuidListCallback networks_changed_observer_;
70 NetworkGuidListCallback network_list_changed_observer_;
72 DISALLOW_COPY_AND_ASSIGN(FakeWiFiService);
75 } // namespace wifi
77 #endif // COMPONENTS_WIFI_FAKE_WIFI_SERVICE_H_