| 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..4100758cc1c30482e0ff2a54205a24094d7938c0 100644
|
| --- a/chromeos/network/shill_property_handler_unittest.cc
|
| +++ b/chromeos/network/shill_property_handler_unittest.cc
|
| @@ -183,6 +183,8 @@ class ShillPropertyHandlerTest : public testing::Test {
|
| profile_test_ =
|
| DBusThreadManager::Get()->GetShillProfileClient()->GetTestInterface();
|
| ASSERT_TRUE(profile_test_);
|
| + if (!LoginState::IsInitialized())
|
| + LoginState::Initialize();
|
| SetupShillPropertyHandler();
|
| message_loop_.RunUntilIdle();
|
| }
|
| @@ -501,4 +503,37 @@ 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());
|
| + LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_ACTIVE,
|
| + LoginState::LOGGED_IN_USER_REGULAR);
|
| + shill_property_handler_->UserPolicyApplied();
|
| + message_loop_.RunUntilIdle();
|
| + // Disabled at user session
|
| + 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
|
|
|