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

Unified Diff: chrome/browser/policy/network_configuration_updater_unittest.cc

Issue 11469026: Extending ONC validator's logging. Completing toplevel validation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@add_error_handling_to_validator
Patch Set: Initial patch. Created 8 years 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
Index: chrome/browser/policy/network_configuration_updater_unittest.cc
diff --git a/chrome/browser/policy/network_configuration_updater_unittest.cc b/chrome/browser/policy/network_configuration_updater_unittest.cc
index 64c47cd8531cfec788ca09f98b9201ce60817099..ae96d96b924a88a187f37841bdbab0e08e2a5ab9 100644
--- a/chrome/browser/policy/network_configuration_updater_unittest.cc
+++ b/chrome/browser/policy/network_configuration_updater_unittest.cc
@@ -6,6 +6,7 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/chromeos/cros/mock_network_library.h"
+#include "chrome/browser/chromeos/network_settings/onc_utils.h"
#include "chrome/browser/policy/mock_configuration_policy_provider.h"
#include "chrome/browser/policy/policy_map.h"
#include "chrome/browser/policy/policy_service_impl.h"
@@ -23,7 +24,7 @@ namespace policy {
static const char kFakeONC[] = "{ \"GUID\": \"1234\" }";
static const char* kEmptyConfiguration =
- NetworkConfigurationUpdater::kEmptyConfiguration;
+ chromeos::onc::kEmptyUnencryptedConfiguration;
class NetworkConfigurationUpdaterTest
: public testing::TestWithParam<const char*>{
@@ -69,7 +70,7 @@ TEST_P(NetworkConfigurationUpdaterTest, InitialUpdates) {
const char* device_onc = GetParam() == key::kDeviceOpenNetworkConfiguration ?
kFakeONC : kEmptyConfiguration;
EXPECT_CALL(network_library_, LoadOncNetworks(
- device_onc, "", chromeos::NetworkUIData::ONC_SOURCE_DEVICE_POLICY, _, _));
+ device_onc, "", chromeos::NetworkUIData::ONC_SOURCE_DEVICE_POLICY, _));
{
NetworkConfigurationUpdater updater(policy_service_.get(),
@@ -79,9 +80,9 @@ TEST_P(NetworkConfigurationUpdaterTest, InitialUpdates) {
// After the user policy is initialized, we always push both policies to the
// NetworkLibrary.
EXPECT_CALL(network_library_, LoadOncNetworks(
- kFakeONC, "", NameToONCSource(GetParam()), _, _));
+ kFakeONC, "", NameToONCSource(GetParam()), _));
EXPECT_CALL(network_library_, LoadOncNetworks(
- kEmptyConfiguration, "", Ne(NameToONCSource(GetParam())), _, _));
+ kEmptyConfiguration, "", Ne(NameToONCSource(GetParam())), _));
EXPECT_CALL(network_library_, RemoveNetworkProfileObserver(_));
@@ -95,7 +96,7 @@ TEST_P(NetworkConfigurationUpdaterTest, AllowWebTrust) {
EXPECT_CALL(network_library_, AddNetworkProfileObserver(_));
// Initially web trust is disabled.
- EXPECT_CALL(network_library_, LoadOncNetworks(_, _, _, false, _))
+ EXPECT_CALL(network_library_, LoadOncNetworks(_, _, _, false))
.Times(AtLeast(0));
NetworkConfigurationUpdater updater(policy_service_.get(),
&network_library_);
@@ -103,7 +104,7 @@ TEST_P(NetworkConfigurationUpdaterTest, AllowWebTrust) {
Mock::VerifyAndClearExpectations(&network_library_);
// Web trust should be forwarded to LoadOncNetworks.
- EXPECT_CALL(network_library_, LoadOncNetworks(_, _, _, true, _))
+ EXPECT_CALL(network_library_, LoadOncNetworks(_, _, _, true))
.Times(AtLeast(0));
updater.set_allow_web_trust(true);
@@ -124,7 +125,7 @@ TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) {
EXPECT_CALL(network_library_, AddNetworkProfileObserver(_));
// Ignore the initial updates.
- EXPECT_CALL(network_library_, LoadOncNetworks(_, _, _, _, _))
+ EXPECT_CALL(network_library_, LoadOncNetworks(_, _, _, _))
.Times(AtLeast(0));
NetworkConfigurationUpdater updater(policy_service_.get(),
&network_library_);
@@ -133,11 +134,11 @@ TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) {
// We should update if policy changes.
EXPECT_CALL(network_library_, LoadOncNetworks(
- kFakeONC, "", NameToONCSource(GetParam()), _, _));
+ kFakeONC, "", NameToONCSource(GetParam()), _));
// In the current implementation, we always apply both policies.
EXPECT_CALL(network_library_, LoadOncNetworks(
- kEmptyConfiguration, "", Ne(NameToONCSource(GetParam())), _, _));
+ kEmptyConfiguration, "", Ne(NameToONCSource(GetParam())), _));
PolicyMap policy;
policy.Set(GetParam(), POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
@@ -149,11 +150,11 @@ TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) {
// implementation, we always apply both policies.
EXPECT_CALL(network_library_, LoadOncNetworks(
kEmptyConfiguration, "",
- chromeos::NetworkUIData::ONC_SOURCE_DEVICE_POLICY, _, _));
+ chromeos::NetworkUIData::ONC_SOURCE_DEVICE_POLICY, _));
EXPECT_CALL(network_library_, LoadOncNetworks(
kEmptyConfiguration, "",
- chromeos::NetworkUIData::ONC_SOURCE_USER_POLICY, _, _));
+ chromeos::NetworkUIData::ONC_SOURCE_USER_POLICY, _));
EXPECT_CALL(network_library_, RemoveNetworkProfileObserver(_));

Powered by Google App Engine
This is Rietveld 408576698