diff options
author | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 15:02:41 +0000 |
---|---|---|
committer | joaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 15:02:41 +0000 |
commit | bfeb6ce8dd3bbccdb048939158c13320cefc35e6 (patch) | |
tree | 564fb1d5639344c6694db0451b5400a49b6a26ce /chrome/browser/policy/network_configuration_updater_unittest.cc | |
parent | ab754fed310c4b16a375368f16dd3b14a38ae997 (diff) | |
download | chromium_src-bfeb6ce8dd3bbccdb048939158c13320cefc35e6.zip chromium_src-bfeb6ce8dd3bbccdb048939158c13320cefc35e6.tar.gz chromium_src-bfeb6ce8dd3bbccdb048939158c13320cefc35e6.tar.bz2 |
Only import certificates with Web trust from ONC if the user is managed and matches the enterprise domain of the device.
BUG=chromium-os:33879
Review URL: https://chromiumcodereview.appspot.com/10868076
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155390 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/policy/network_configuration_updater_unittest.cc')
-rw-r--r-- | chrome/browser/policy/network_configuration_updater_unittest.cc | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/chrome/browser/policy/network_configuration_updater_unittest.cc b/chrome/browser/policy/network_configuration_updater_unittest.cc index a61a1c2..51ae40f9 100644 --- a/chrome/browser/policy/network_configuration_updater_unittest.cc +++ b/chrome/browser/policy/network_configuration_updater_unittest.cc @@ -25,7 +25,7 @@ class NetworkConfigurationUpdaterTest : public testing::TestWithParam<const char*> { protected: virtual void SetUp() OVERRIDE { - EXPECT_CALL(network_library_, LoadOncNetworks(_, "", _, _)) + EXPECT_CALL(network_library_, LoadOncNetworks(_, "", _, _, _)) .WillRepeatedly(Return(true)); EXPECT_CALL(provider_, IsInitializationComplete()) .WillRepeatedly(Return(true)); @@ -56,19 +56,37 @@ TEST_P(NetworkConfigurationUpdaterTest, InitialUpdate) { provider_.UpdateChromePolicy(policy); EXPECT_CALL(network_library_, - LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), _)) + LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), + false, _)) .WillOnce(Return(true)); NetworkConfigurationUpdater updater(policy_service_.get(), &network_library_); Mock::VerifyAndClearExpectations(&network_library_); } +TEST_P(NetworkConfigurationUpdaterTest, AllowWebTrust) { + NetworkConfigurationUpdater updater(policy_service_.get(), &network_library_); + updater.set_allow_web_trust(true); + + EXPECT_CALL(network_library_, + LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), + true, _)) + .WillOnce(Return(true)); + + PolicyMap policy; + policy.Set(GetParam(), POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, + Value::CreateStringValue(kFakeONC)); + provider_.UpdateChromePolicy(policy); + Mock::VerifyAndClearExpectations(&network_library_); +} + TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) { NetworkConfigurationUpdater updater(policy_service_.get(), &network_library_); // We should update if policy changes. EXPECT_CALL(network_library_, - LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), _)) + LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), + false, _)) .WillOnce(Return(true)); PolicyMap policy; policy.Set(GetParam(), POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, @@ -78,7 +96,8 @@ TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) { // No update if the set the same value again. EXPECT_CALL(network_library_, - LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), _)) + LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), + false, _)) .Times(0); provider_.UpdateChromePolicy(policy); Mock::VerifyAndClearExpectations(&network_library_); @@ -86,7 +105,7 @@ TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) { // Another update is expected if the policy goes away. EXPECT_CALL(network_library_, LoadOncNetworks(NetworkConfigurationUpdater::kEmptyConfiguration, - "", NameToONCSource(GetParam()), _)) + "", NameToONCSource(GetParam()), false, _)) .WillOnce(Return(true)); policy.Erase(GetParam()); provider_.UpdateChromePolicy(policy); |