diff options
Diffstat (limited to 'chromeos/network/shill_property_handler_unittest.cc')
-rw-r--r-- | chromeos/network/shill_property_handler_unittest.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/chromeos/network/shill_property_handler_unittest.cc b/chromeos/network/shill_property_handler_unittest.cc index 3f705ab..7593194 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 |