Chromium Code Reviews| 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 30ebd10be212c16b52d0e9274ae5dd748a9b8388..9df809dff98d932fce6a3e871444953519b54491 100644 |
| --- a/chrome/browser/policy/network_configuration_updater_unittest.cc |
| +++ b/chrome/browser/policy/network_configuration_updater_unittest.cc |
| @@ -4,9 +4,11 @@ |
| #include "chrome/browser/policy/network_configuration_updater.h" |
| +#include "base/memory/scoped_ptr.h" |
| #include "chrome/browser/chromeos/cros/mock_network_library.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" |
| #include "policy/policy_constants.h" |
| #include "testing/gmock/include/gmock/gmock.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -25,6 +27,9 @@ class NetworkConfigurationUpdaterTest |
| virtual void SetUp() OVERRIDE { |
| EXPECT_CALL(network_library_, LoadOncNetworks(_, "", _, _)) |
| .WillRepeatedly(Return(true)); |
| + PolicyServiceImpl::Providers providers; |
| + providers.push_back(&provider_); |
| + policy_service_.reset(new PolicyServiceImpl(providers)); |
| } |
| // Maps configuration policy name to corresponding ONC source. |
| @@ -39,6 +44,7 @@ class NetworkConfigurationUpdaterTest |
| chromeos::MockNetworkLibrary network_library_; |
| MockConfigurationPolicyProvider provider_; |
| + scoped_ptr<PolicyServiceImpl> policy_service_; |
|
Mattias Nissler (ping if slow)
2012/05/14 08:14:25
I guess we eventually want a MockPolicyService tha
|
| }; |
| TEST_P(NetworkConfigurationUpdaterTest, InitialUpdate) { |
| @@ -51,12 +57,12 @@ TEST_P(NetworkConfigurationUpdaterTest, InitialUpdate) { |
| LoadOncNetworks(kFakeONC, "", NameToONCSource(GetParam()), _)) |
| .WillOnce(Return(true)); |
| - NetworkConfigurationUpdater updater(&provider_, &network_library_); |
| + NetworkConfigurationUpdater updater(policy_service_.get(), &network_library_); |
| Mock::VerifyAndClearExpectations(&network_library_); |
| } |
| TEST_P(NetworkConfigurationUpdaterTest, PolicyChange) { |
| - NetworkConfigurationUpdater updater(&provider_, &network_library_); |
| + NetworkConfigurationUpdater updater(policy_service_.get(), &network_library_); |
| // We should update if policy changes. |
| EXPECT_CALL(network_library_, |