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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chromeos/network/shill_property_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/network/shill_property_handler.h" 5 #include "chromeos/network/shill_property_handler.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 AddServiceToProfile(shill::kTypeWifi, kTestServicePath2, true); 494 AddServiceToProfile(shill::kTypeWifi, kTestServicePath2, true);
495 shill_property_handler_->UpdateManagerProperties(); 495 shill_property_handler_->UpdateManagerProperties();
496 message_loop_.RunUntilIdle(); 496 message_loop_.RunUntilIdle();
497 EXPECT_EQ(1, listener_->list_updates(shill::kServiceCompleteListProperty)); 497 EXPECT_EQ(1, listener_->list_updates(shill::kServiceCompleteListProperty));
498 EXPECT_EQ(1, listener_->initial_property_updates( 498 EXPECT_EQ(1, listener_->initial_property_updates(
499 shill::kServiceCompleteListProperty)[kTestServicePath2]); 499 shill::kServiceCompleteListProperty)[kTestServicePath2]);
500 EXPECT_EQ(1, listener_->property_updates( 500 EXPECT_EQ(1, listener_->property_updates(
501 shill::kServiceCompleteListProperty)[kTestServicePath2]); 501 shill::kServiceCompleteListProperty)[kTestServicePath2]);
502 } 502 }
503 503
504 TEST_F(ShillPropertyHandlerTest, ProhibitedTechnologies) {
505 std::vector<std::string> prohibited_technologies;
506 prohibited_technologies.push_back(shill::kTypeEthernet);
507 EXPECT_TRUE(
508 shill_property_handler_->IsTechnologyEnabled(shill::kTypeEthernet));
509 shill_property_handler_->SetProhibitedTechnologies(
510 prohibited_technologies, network_handler::ErrorCallback());
511 message_loop_.RunUntilIdle();
512 // Disabled
513 EXPECT_FALSE(
514 shill_property_handler_->IsTechnologyEnabled(shill::kTypeEthernet));
515
516 // Can not enable it back
517 shill_property_handler_->SetTechnologyEnabled(
518 shill::kTypeEthernet, true, network_handler::ErrorCallback());
519 message_loop_.RunUntilIdle();
520 EXPECT_FALSE(
521 shill_property_handler_->IsTechnologyEnabled(shill::kTypeEthernet));
522
523 // Can enable it back after policy changes
524 prohibited_technologies.clear();
525 shill_property_handler_->SetProhibitedTechnologies(
526 prohibited_technologies, network_handler::ErrorCallback());
527 shill_property_handler_->SetTechnologyEnabled(
528 shill::kTypeEthernet, true, network_handler::ErrorCallback());
529 message_loop_.RunUntilIdle();
530 EXPECT_TRUE(
531 shill_property_handler_->IsTechnologyEnabled(shill::kTypeEthernet));
532 }
533
504 } // namespace chromeos 534 } // namespace chromeos
OLDNEW
« 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