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

Unified Diff: chromeos/network/managed_network_configuration_handler_unittest.cc

Issue 647783005: Set Service property ManagedCredentials for managed networks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | chromeos/network/policy_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/managed_network_configuration_handler_unittest.cc
diff --git a/chromeos/network/managed_network_configuration_handler_unittest.cc b/chromeos/network/managed_network_configuration_handler_unittest.cc
index 94f909886e9a70197a044f125c8af3d5568c1162..ad825f6fba353533a3d581ed7a2af5cb7f69fbfa 100644
--- a/chromeos/network/managed_network_configuration_handler_unittest.cc
+++ b/chromeos/network/managed_network_configuration_handler_unittest.cc
@@ -417,6 +417,46 @@ TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyManageUnconfigured) {
message_loop_.RunUntilIdle();
}
+TEST_F(ManagedNetworkConfigurationHandlerTest, EnableManagedCredentialsWiFi) {
+ InitializeStandardProfiles();
+ scoped_ptr<base::DictionaryValue> expected_shill_properties =
+ test_utils::ReadTestDictionary(
+ "policy/shill_policy_autoconnect_on_unconfigured_wifi1.json");
+
+ EXPECT_CALL(*mock_profile_client_,
+ GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
+
+ EXPECT_CALL(*mock_manager_client_,
+ ConfigureServiceForProfile(
+ dbus::ObjectPath(kUser1ProfilePath),
+ IsEqualTo(expected_shill_properties.get()),
+ _, _));
+
+ SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1,
+ "policy/policy_wifi1_autoconnect.onc");
+ message_loop_.RunUntilIdle();
+}
+
+TEST_F(ManagedNetworkConfigurationHandlerTest, EnableManagedCredentialsVPN) {
+ InitializeStandardProfiles();
+ scoped_ptr<base::DictionaryValue> expected_shill_properties =
+ test_utils::ReadTestDictionary(
+ "policy/shill_policy_autoconnect_on_unconfigured_vpn.json");
+
+ EXPECT_CALL(*mock_profile_client_,
+ GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
+
+ EXPECT_CALL(*mock_manager_client_,
+ ConfigureServiceForProfile(
+ dbus::ObjectPath(kUser1ProfilePath),
+ IsEqualTo(expected_shill_properties.get()),
+ _, _));
+
+ SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1,
+ "policy/policy_vpn_autoconnect.onc");
+ message_loop_.RunUntilIdle();
+}
+
// Ensure that EAP settings for ethernet are matched with the right profile
// entry and written to the dedicated EthernetEAP service.
TEST_F(ManagedNetworkConfigurationHandlerTest,
« no previous file with comments | « no previous file | chromeos/network/policy_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698