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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | chromeos/network/policy_util.cc » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <iostream> 5 #include <iostream>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 EXPECT_CALL(*mock_manager_client_, 410 EXPECT_CALL(*mock_manager_client_,
411 ConfigureServiceForProfile( 411 ConfigureServiceForProfile(
412 dbus::ObjectPath(kUser1ProfilePath), 412 dbus::ObjectPath(kUser1ProfilePath),
413 IsEqualTo(expected_shill_properties.get()), 413 IsEqualTo(expected_shill_properties.get()),
414 _, _)); 414 _, _));
415 415
416 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); 416 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
417 message_loop_.RunUntilIdle(); 417 message_loop_.RunUntilIdle();
418 } 418 }
419 419
420 TEST_F(ManagedNetworkConfigurationHandlerTest, EnableManagedCredentialsWiFi) {
421 InitializeStandardProfiles();
422 scoped_ptr<base::DictionaryValue> expected_shill_properties =
423 test_utils::ReadTestDictionary(
424 "policy/shill_policy_autoconnect_on_unconfigured_wifi1.json");
425
426 EXPECT_CALL(*mock_profile_client_,
427 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
428
429 EXPECT_CALL(*mock_manager_client_,
430 ConfigureServiceForProfile(
431 dbus::ObjectPath(kUser1ProfilePath),
432 IsEqualTo(expected_shill_properties.get()),
433 _, _));
434
435 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1,
436 "policy/policy_wifi1_autoconnect.onc");
437 message_loop_.RunUntilIdle();
438 }
439
440 TEST_F(ManagedNetworkConfigurationHandlerTest, EnableManagedCredentialsVPN) {
441 InitializeStandardProfiles();
442 scoped_ptr<base::DictionaryValue> expected_shill_properties =
443 test_utils::ReadTestDictionary(
444 "policy/shill_policy_autoconnect_on_unconfigured_vpn.json");
445
446 EXPECT_CALL(*mock_profile_client_,
447 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
448
449 EXPECT_CALL(*mock_manager_client_,
450 ConfigureServiceForProfile(
451 dbus::ObjectPath(kUser1ProfilePath),
452 IsEqualTo(expected_shill_properties.get()),
453 _, _));
454
455 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1,
456 "policy/policy_vpn_autoconnect.onc");
457 message_loop_.RunUntilIdle();
458 }
459
420 // Ensure that EAP settings for ethernet are matched with the right profile 460 // Ensure that EAP settings for ethernet are matched with the right profile
421 // entry and written to the dedicated EthernetEAP service. 461 // entry and written to the dedicated EthernetEAP service.
422 TEST_F(ManagedNetworkConfigurationHandlerTest, 462 TEST_F(ManagedNetworkConfigurationHandlerTest,
423 SetPolicyManageUnmanagedEthernetEAP) { 463 SetPolicyManageUnmanagedEthernetEAP) {
424 InitializeStandardProfiles(); 464 InitializeStandardProfiles();
425 scoped_ptr<base::DictionaryValue> expected_shill_properties = 465 scoped_ptr<base::DictionaryValue> expected_shill_properties =
426 test_utils::ReadTestDictionary( 466 test_utils::ReadTestDictionary(
427 "policy/" 467 "policy/"
428 "shill_policy_on_unmanaged_ethernet_eap.json"); 468 "shill_policy_on_unmanaged_ethernet_eap.json");
429 469
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
954 EXPECT_CALL(*mock_profile_client_, 994 EXPECT_CALL(*mock_profile_client_,
955 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _)); 995 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
956 996
957 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); 997 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
958 managed_network_configuration_handler_->RemoveObserver(&policy_observer_); 998 managed_network_configuration_handler_->RemoveObserver(&policy_observer_);
959 managed_network_configuration_handler_.reset(); 999 managed_network_configuration_handler_.reset();
960 message_loop_.RunUntilIdle(); 1000 message_loop_.RunUntilIdle();
961 } 1001 }
962 1002
963 } // namespace chromeos 1003 } // namespace chromeos
OLDNEW
« 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