Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/policy/network_configuration_updater.h" | 5 #include "chrome/browser/policy/network_configuration_updater.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/chromeos/cros/mock_network_library.h" | 8 #include "chrome/browser/chromeos/cros/mock_network_library.h" |
| 9 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 9 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
| 10 #include "chrome/browser/policy/policy_map.h" | 10 #include "chrome/browser/policy/policy_map.h" |
| 11 #include "chrome/browser/policy/policy_service_impl.h" | 11 #include "chrome/browser/policy/policy_service_impl.h" |
| 12 #include "chromeos/network/onc/onc_constants.h" | 12 #include "chromeos/network/onc/onc_constants.h" |
| 13 #include "chromeos/network/onc/onc_utils.h" | |
| 13 #include "policy/policy_constants.h" | 14 #include "policy/policy_constants.h" |
| 14 #include "testing/gmock/include/gmock/gmock.h" | 15 #include "testing/gmock/include/gmock/gmock.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 16 | 17 |
| 17 using testing::AtLeast; | 18 using testing::AtLeast; |
| 18 using testing::Mock; | 19 using testing::Mock; |
| 19 using testing::Ne; | 20 using testing::Ne; |
| 20 using testing::Return; | 21 using testing::Return; |
| 21 using testing::_; | 22 using testing::_; |
| 22 | 23 |
| 23 namespace policy { | 24 namespace policy { |
| 24 | 25 |
| 25 static const char kFakeONC[] = "{ \"GUID\": \"1234\" }"; | 26 static const char kFakeONC[] = "{ \"GUID\": \"1234\" }"; |
| 26 static const char* kEmptyConfiguration = | 27 static const char* kEmptyConfiguration = |
| 27 NetworkConfigurationUpdater::kEmptyConfiguration; | 28 chromeos::onc::kEmptyUnencryptedConfiguration; |
|
Joao da Silva
2012/12/13 09:51:35
Why not just remove kEmptyConfiguration and replac
pneubeck (no reviews)
2012/12/13 14:10:03
(Because it's longer.) Replaced.
| |
| 28 | 29 |
| 29 class NetworkConfigurationUpdaterTest | 30 class NetworkConfigurationUpdaterTest |
| 30 : public testing::TestWithParam<const char*>{ | 31 : public testing::TestWithParam<const char*>{ |
| 31 protected: | 32 protected: |
| 32 virtual void SetUp() OVERRIDE { | 33 virtual void SetUp() OVERRIDE { |
| 33 EXPECT_CALL(provider_, IsInitializationComplete()) | 34 EXPECT_CALL(provider_, IsInitializationComplete()) |
| 34 .WillRepeatedly(Return(true)); | 35 .WillRepeatedly(Return(true)); |
| 35 provider_.Init(); | 36 provider_.Init(); |
| 36 PolicyServiceImpl::Providers providers; | 37 PolicyServiceImpl::Providers providers; |
| 37 providers.push_back(&provider_); | 38 providers.push_back(&provider_); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 Mock::VerifyAndClearExpectations(&network_library_); | 165 Mock::VerifyAndClearExpectations(&network_library_); |
| 165 } | 166 } |
| 166 | 167 |
| 167 INSTANTIATE_TEST_CASE_P( | 168 INSTANTIATE_TEST_CASE_P( |
| 168 NetworkConfigurationUpdaterTestInstance, | 169 NetworkConfigurationUpdaterTestInstance, |
| 169 NetworkConfigurationUpdaterTest, | 170 NetworkConfigurationUpdaterTest, |
| 170 testing::Values(key::kDeviceOpenNetworkConfiguration, | 171 testing::Values(key::kDeviceOpenNetworkConfiguration, |
| 171 key::kOpenNetworkConfiguration)); | 172 key::kOpenNetworkConfiguration)); |
| 172 | 173 |
| 173 } // namespace policy | 174 } // namespace policy |
| OLD | NEW |