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/chromeos/network_settings/onc_utils.h" |
9 #include "chrome/browser/policy/mock_configuration_policy_provider.h" | 10 #include "chrome/browser/policy/mock_configuration_policy_provider.h" |
10 #include "chrome/browser/policy/policy_map.h" | 11 #include "chrome/browser/policy/policy_map.h" |
11 #include "chrome/browser/policy/policy_service_impl.h" | 12 #include "chrome/browser/policy/policy_service_impl.h" |
12 #include "policy/policy_constants.h" | 13 #include "policy/policy_constants.h" |
13 #include "testing/gmock/include/gmock/gmock.h" | 14 #include "testing/gmock/include/gmock/gmock.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 | 16 |
16 using testing::AtLeast; | 17 using testing::AtLeast; |
17 using testing::Mock; | 18 using testing::Mock; |
18 using testing::Ne; | 19 using testing::Ne; |
19 using testing::Return; | 20 using testing::Return; |
20 using testing::_; | 21 using testing::_; |
21 | 22 |
22 namespace policy { | 23 namespace policy { |
23 | 24 |
24 static const char kFakeONC[] = "{ \"GUID\": \"1234\" }"; | 25 static const char kFakeONC[] = "{ \"GUID\": \"1234\" }"; |
25 static const char* kEmptyConfiguration = | 26 static const char* kEmptyConfiguration = |
26 NetworkConfigurationUpdater::kEmptyConfiguration; | 27 chromeos::onc::kEmptyUnencryptedConfiguration; |
27 | 28 |
28 class NetworkConfigurationUpdaterTest | 29 class NetworkConfigurationUpdaterTest |
29 : public testing::TestWithParam<const char*>{ | 30 : public testing::TestWithParam<const char*>{ |
30 protected: | 31 protected: |
31 virtual void SetUp() OVERRIDE { | 32 virtual void SetUp() OVERRIDE { |
32 EXPECT_CALL(provider_, IsInitializationComplete()) | 33 EXPECT_CALL(provider_, IsInitializationComplete()) |
33 .WillRepeatedly(Return(true)); | 34 .WillRepeatedly(Return(true)); |
34 provider_.Init(); | 35 provider_.Init(); |
35 PolicyServiceImpl::Providers providers; | 36 PolicyServiceImpl::Providers providers; |
36 providers.push_back(&provider_); | 37 providers.push_back(&provider_); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 Mock::VerifyAndClearExpectations(&network_library_); | 164 Mock::VerifyAndClearExpectations(&network_library_); |
164 } | 165 } |
165 | 166 |
166 INSTANTIATE_TEST_CASE_P( | 167 INSTANTIATE_TEST_CASE_P( |
167 NetworkConfigurationUpdaterTestInstance, | 168 NetworkConfigurationUpdaterTestInstance, |
168 NetworkConfigurationUpdaterTest, | 169 NetworkConfigurationUpdaterTest, |
169 testing::Values(key::kDeviceOpenNetworkConfiguration, | 170 testing::Values(key::kDeviceOpenNetworkConfiguration, |
170 key::kOpenNetworkConfiguration)); | 171 key::kOpenNetworkConfiguration)); |
171 | 172 |
172 } // namespace policy | 173 } // namespace policy |
OLD | NEW |