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

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') | chromeos/network/policy_util.cc » ('J')
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/location.h" 9 #include "base/location.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 EXPECT_CALL(*mock_manager_client_, 372 EXPECT_CALL(*mock_manager_client_,
373 ConfigureServiceForProfile( 373 ConfigureServiceForProfile(
374 dbus::ObjectPath(kUser1ProfilePath), 374 dbus::ObjectPath(kUser1ProfilePath),
375 IsEqualTo(expected_shill_properties.get()), 375 IsEqualTo(expected_shill_properties.get()),
376 _, _)); 376 _, _));
377 377
378 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); 378 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
379 message_loop_.RunUntilIdle(); 379 message_loop_.RunUntilIdle();
380 } 380 }
381 381
382 TEST_F(ManagedNetworkConfigurationHandlerTest, EnableManagedCredentialsWiFi) {
383 InitializeStandardProfiles();
384 scoped_ptr<base::DictionaryValue> expected_shill_properties =
385 test_utils::ReadTestDictionary(
386 "policy/shill_policy_autoconnect_on_unconfigured_wifi1.json");
387
388 EXPECT_CALL(*mock_profile_client_,
389 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
390
391 EXPECT_CALL(*mock_manager_client_,
392 ConfigureServiceForProfile(
393 dbus::ObjectPath(kUser1ProfilePath),
394 IsEqualTo(expected_shill_properties.get()),
395 _, _));
396
397 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1,
398 "policy/policy_wifi1_autoconnect.onc");
399 message_loop_.RunUntilIdle();
400 }
401
402 TEST_F(ManagedNetworkConfigurationHandlerTest, EnableManagedCredentialsVPN) {
403 InitializeStandardProfiles();
404 scoped_ptr<base::DictionaryValue> expected_shill_properties =
405 test_utils::ReadTestDictionary(
406 "policy/shill_policy_autoconnect_on_unconfigured_vpn.json");
407
408 EXPECT_CALL(*mock_profile_client_,
409 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
410
411 EXPECT_CALL(*mock_manager_client_,
412 ConfigureServiceForProfile(
413 dbus::ObjectPath(kUser1ProfilePath),
414 IsEqualTo(expected_shill_properties.get()),
415 _, _));
416
417 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1,
418 "policy/policy_vpn_autoconnect.onc");
419 message_loop_.RunUntilIdle();
420 }
421
382 // Ensure that EAP settings for ethernet are matched with the right profile 422 // Ensure that EAP settings for ethernet are matched with the right profile
383 // entry and written to the dedicated EthernetEAP service. 423 // entry and written to the dedicated EthernetEAP service.
384 TEST_F(ManagedNetworkConfigurationHandlerTest, 424 TEST_F(ManagedNetworkConfigurationHandlerTest,
385 SetPolicyManageUnmanagedEthernetEAP) { 425 SetPolicyManageUnmanagedEthernetEAP) {
386 InitializeStandardProfiles(); 426 InitializeStandardProfiles();
387 scoped_ptr<base::DictionaryValue> expected_shill_properties = 427 scoped_ptr<base::DictionaryValue> expected_shill_properties =
388 test_utils::ReadTestDictionary( 428 test_utils::ReadTestDictionary(
389 "policy/" 429 "policy/"
390 "shill_policy_on_unmanaged_ethernet_eap.json"); 430 "shill_policy_on_unmanaged_ethernet_eap.json");
391 431
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 878
839 EXPECT_CALL(*mock_profile_client_, 879 EXPECT_CALL(*mock_profile_client_,
840 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _)); 880 GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _));
841 881
842 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); 882 SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc");
843 managed_network_configuration_handler_.reset(); 883 managed_network_configuration_handler_.reset();
844 message_loop_.RunUntilIdle(); 884 message_loop_.RunUntilIdle();
845 } 885 }
846 886
847 } // namespace chromeos 887 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chromeos/network/policy_util.cc » ('j') | chromeos/network/policy_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698