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

Unified Diff: chromeos/network/managed_network_configuration_handler_unittest.cc

Issue 23451044: Add an Ethernet EAP policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed remaining comments. # Created 7 years, 3 months 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/device_state.cc ('k') | chromeos/network/network_state_handler.h » ('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 c2eca5e6710ada03ad5402875dfbce086c5b4546..ef76586ace7d6e955a0f02a91c9819e5643003c8 100644
--- a/chromeos/network/managed_network_configuration_handler_unittest.cc
+++ b/chromeos/network/managed_network_configuration_handler_unittest.cc
@@ -5,6 +5,7 @@
#include <iostream>
#include <sstream>
+#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/mock_dbus_thread_manager.h"
@@ -309,6 +310,47 @@ TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyManageUnconfigured) {
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,
+ SetPolicyManageUnmanagedEthernetEAP) {
+ InitializeStandardProfiles();
+ scoped_ptr<base::DictionaryValue> expected_shill_properties =
+ test_utils::ReadTestDictionary(
+ "policy/"
+ "shill_policy_on_unmanaged_ethernet_eap.json");
+
+ SetUpEntry("policy/shill_unmanaged_ethernet_eap.json",
+ kUser1ProfilePath,
+ "eth_entry");
+
+ // Also setup an unrelated WiFi configuration to verify that the right entry
+ // is matched.
+ SetUpEntry("policy/shill_unmanaged_user_wifi1.json",
+ kUser1ProfilePath,
+ "wifi_entry");
+
+ EXPECT_CALL(mock_profile_client_,
+ GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
+
+ EXPECT_CALL(mock_profile_client_,
+ GetEntry(dbus::ObjectPath(kUser1ProfilePath), _, _, _)).Times(2);
+
+ EXPECT_CALL(
+ mock_profile_client_,
+ DeleteEntry(dbus::ObjectPath(kUser1ProfilePath), "eth_entry", _, _));
+
+ EXPECT_CALL(
+ mock_manager_client_,
+ ConfigureServiceForProfile(dbus::ObjectPath(kUser1ProfilePath),
+ IsEqualTo(expected_shill_properties.get()),
+ _, _));
+
+ SetPolicy(
+ onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_ethernet_eap.onc");
+ message_loop_.RunUntilIdle();
+}
+
TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyIgnoreUnmodified) {
InitializeStandardProfiles();
EXPECT_CALL(mock_profile_client_, GetProperties(_, _, _));
@@ -325,10 +367,9 @@ TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyIgnoreUnmodified) {
EXPECT_CALL(mock_profile_client_, GetProperties(_, _, _));
- EXPECT_CALL(mock_profile_client_,
- GetEntry(dbus::ObjectPath(kUser1ProfilePath),
- "some_entry_path",
- _, _));
+ EXPECT_CALL(
+ mock_profile_client_,
+ GetEntry(dbus::ObjectPath(kUser1ProfilePath), "some_entry_path", _, _));
SetPolicy(onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
message_loop_.RunUntilIdle();
« no previous file with comments | « chromeos/network/device_state.cc ('k') | chromeos/network/network_state_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698