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

Unified Diff: chromeos/network/network_configuration_handler_unittest.cc

Issue 2836083002: [CrOS Tether] Update NetworkConfigurationHandler::GetShillProperties() to work with Tether networks. (Closed)
Patch Set: stevenjb@ comments. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/network_configuration_handler.cc ('k') | chromeos/network/network_state_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_configuration_handler_unittest.cc
diff --git a/chromeos/network/network_configuration_handler_unittest.cc b/chromeos/network/network_configuration_handler_unittest.cc
index 554d9303b1c2f4436a7db08109e529f32f932a94..bfe347164d14e78b9bed054b587d21c9dc109b68 100644
--- a/chromeos/network/network_configuration_handler_unittest.cc
+++ b/chromeos/network/network_configuration_handler_unittest.cc
@@ -361,6 +361,37 @@ TEST_F(NetworkConfigurationHandlerTest, GetProperties) {
base::RunLoop().RunUntilIdle();
}
+TEST_F(NetworkConfigurationHandlerTest, GetProperties_TetherNetwork) {
+ network_state_handler_->SetTetherTechnologyState(
+ NetworkStateHandler::TechnologyState::TECHNOLOGY_ENABLED);
+
+ std::string kTetherGuid = "TetherGuid";
+ network_state_handler_->AddTetherNetworkState(
+ kTetherGuid, "TetherNetworkName", "TetherNetworkCarrier",
+ 100 /* battery_percentage */, 100 /* signal_strength */);
+
+ std::string expected_json =
+ "{\n "
+ "\"GUID\": \"TetherGuid\",\n "
+ "\"Name\": \"TetherNetworkName\",\n "
+ "\"Priority\": 0,\n "
+ "\"Profile\": \"\",\n "
+ "\"SecurityClass\": \"\",\n "
+ "\"State\": \"\",\n "
+ "\"Tether.BatteryPercentage\": 100,\n "
+ "\"Tether.Carrier\": \"TetherNetworkCarrier\",\n "
+ "\"Tether.SignalStrength\": 100,\n "
+ "\"Type\": \"wifi-tether\"\n"
+ "}\n";
+
+ // Tether networks use service path and GUID interchangeably.
+ std::string& tether_service_path = kTetherGuid;
+ network_configuration_handler_->GetShillProperties(
+ tether_service_path,
+ base::Bind(&DictionaryValueCallback, tether_service_path, expected_json),
+ base::Bind(&ErrorCallback));
+}
+
TEST_F(NetworkConfigurationHandlerTest, SetProperties) {
std::string service_path = "/service/1";
std::string networkName = "MyNetwork";
« no previous file with comments | « chromeos/network/network_configuration_handler.cc ('k') | chromeos/network/network_state_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698