Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: chromeos/network/network_state_test.h

Issue 2787613002: Add NetworkStateTest helper class (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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.
4
5 #ifndef CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_
6 #define CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_
7
8 #include <memory>
9
10 #include "chromeos/dbus/shill_manager_client.h"
11 #include "chromeos/network/network_state_handler.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace chromeos {
15
16 // Class for tests that need NetworkStateHandler. Handles initialization,
17 // shutdown, and adds default profiles and a wifi device.
18 class NetworkStateTest : public testing::Test {
19 public:
20 NetworkStateTest();
21 ~NetworkStateTest() override;
22
23 // DBusThreadManager::Initialize() must be called before SetUp().
24 void SetUp() override;
25 void TearDown() override;
26
27 // Call this before TearDown() to shut down NetworkStateHandler.
28 void ShutdownNetworkState();
29
30 // Configures a new service using Shill properties from |shill_json_string|
31 // which must include a GUID and Type.
32 bool ConfigureService(const std::string& shill_json_string);
33
34 // Returns a string value for property |key| associated with |service_path|.
35 // The result will be empty if the service or property do not exist.
36 std::string GetServiceStringProperty(const std::string& service_path,
Kyle Horimoto 2017/03/29 20:18:32 Should this class also have a mechanism for settin
stevenjb 2017/03/29 20:29:16 If/when we need it we can and should add it. The c
37 const std::string& key);
38
39 ShillManagerClient::TestInterface* test_manager_client() {
40 return test_manager_client_;
41 }
42 NetworkStateHandler* network_state_handler() {
43 return network_state_handler_.get();
44 }
45
46 static const char kUserHash[];
47
48 private:
49 ShillManagerClient::TestInterface* test_manager_client_ = nullptr;
50 std::unique_ptr<NetworkStateHandler> network_state_handler_;
51 };
52
53 } // namespace chromeos
54
55 #endif // CHROMEOS_DBUS_SHILL_CLIENT_UNITTEST_BASE_H_
OLDNEW
« no previous file with comments | « chromeos/network/network_connection_handler_unittest.cc ('k') | chromeos/network/network_state_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698