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

Unified Diff: chromeos/network/shill_property_handler_unittest.cc

Issue 1431563005: Handle prohibited technologies in device policy ONC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/shill_property_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/shill_property_handler_unittest.cc
diff --git a/chromeos/network/shill_property_handler_unittest.cc b/chromeos/network/shill_property_handler_unittest.cc
index 3f705ab7c2aa0b23497f6d314a51d24cc3d594ba..75931942d925f07bd0908f878d8b1a79532b526a 100644
--- a/chromeos/network/shill_property_handler_unittest.cc
+++ b/chromeos/network/shill_property_handler_unittest.cc
@@ -501,4 +501,34 @@ TEST_F(ShillPropertyHandlerTest, ShillPropertyHandlerServiceList) {
shill::kServiceCompleteListProperty)[kTestServicePath2]);
}
+TEST_F(ShillPropertyHandlerTest, ProhibitedTechnologies) {
+ std::vector<std::string> prohibited_technologies;
+ prohibited_technologies.push_back(shill::kTypeEthernet);
+ EXPECT_TRUE(
+ shill_property_handler_->IsTechnologyEnabled(shill::kTypeEthernet));
+ shill_property_handler_->SetProhibitedTechnologies(
+ prohibited_technologies, network_handler::ErrorCallback());
+ message_loop_.RunUntilIdle();
+ // Disabled
+ EXPECT_FALSE(
+ shill_property_handler_->IsTechnologyEnabled(shill::kTypeEthernet));
+
+ // Can not enable it back
+ shill_property_handler_->SetTechnologyEnabled(
+ shill::kTypeEthernet, true, network_handler::ErrorCallback());
+ message_loop_.RunUntilIdle();
+ EXPECT_FALSE(
+ shill_property_handler_->IsTechnologyEnabled(shill::kTypeEthernet));
+
+ // Can enable it back after policy changes
+ prohibited_technologies.clear();
+ shill_property_handler_->SetProhibitedTechnologies(
+ prohibited_technologies, network_handler::ErrorCallback());
+ shill_property_handler_->SetTechnologyEnabled(
+ shill::kTypeEthernet, true, network_handler::ErrorCallback());
+ message_loop_.RunUntilIdle();
+ EXPECT_TRUE(
+ shill_property_handler_->IsTechnologyEnabled(shill::kTypeEthernet));
+}
+
} // namespace chromeos
« no previous file with comments | « chromeos/network/shill_property_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698