| OLD | NEW |
| (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, |
| 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_ |
| OLD | NEW |