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

Side by Side Diff: chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc

Issue 1100223002: Update {virtual,override} to follow C++11 style in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 8 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 *arg2 = list; 194 *arg2 = list;
195 return true; 195 return true;
196 } 196 }
197 197
198 } // namespace 198 } // namespace
199 199
200 class NetworkConfigurationUpdaterTest : public testing::Test { 200 class NetworkConfigurationUpdaterTest : public testing::Test {
201 protected: 201 protected:
202 NetworkConfigurationUpdaterTest() : certificate_importer_(NULL) {} 202 NetworkConfigurationUpdaterTest() : certificate_importer_(NULL) {}
203 203
204 virtual void SetUp() override { 204 void SetUp() override {
205 EXPECT_CALL(provider_, IsInitializationComplete(_)) 205 EXPECT_CALL(provider_, IsInitializationComplete(_))
206 .WillRepeatedly(Return(false)); 206 .WillRepeatedly(Return(false));
207 provider_.Init(); 207 provider_.Init();
208 PolicyServiceImpl::Providers providers; 208 PolicyServiceImpl::Providers providers;
209 providers.push_back(&provider_); 209 providers.push_back(&provider_);
210 policy_service_.reset(new PolicyServiceImpl(providers)); 210 policy_service_.reset(new PolicyServiceImpl(providers));
211 211
212 scoped_ptr<base::DictionaryValue> fake_toplevel_onc = 212 scoped_ptr<base::DictionaryValue> fake_toplevel_onc =
213 chromeos::onc::ReadDictionaryFromJson(kFakeONC); 213 chromeos::onc::ReadDictionaryFromJson(kFakeONC);
214 214
215 base::ListValue* network_configs = NULL; 215 base::ListValue* network_configs = NULL;
216 fake_toplevel_onc->GetListWithoutPathExpansion( 216 fake_toplevel_onc->GetListWithoutPathExpansion(
217 onc::toplevel_config::kNetworkConfigurations, &network_configs); 217 onc::toplevel_config::kNetworkConfigurations, &network_configs);
218 AppendAll(*network_configs, &fake_network_configs_); 218 AppendAll(*network_configs, &fake_network_configs_);
219 219
220 base::DictionaryValue* global_config = NULL; 220 base::DictionaryValue* global_config = NULL;
221 fake_toplevel_onc->GetDictionaryWithoutPathExpansion( 221 fake_toplevel_onc->GetDictionaryWithoutPathExpansion(
222 onc::toplevel_config::kGlobalNetworkConfiguration, &global_config); 222 onc::toplevel_config::kGlobalNetworkConfiguration, &global_config);
223 fake_global_network_config_.MergeDictionary(global_config); 223 fake_global_network_config_.MergeDictionary(global_config);
224 224
225 base::ListValue* certs = NULL; 225 base::ListValue* certs = NULL;
226 fake_toplevel_onc->GetListWithoutPathExpansion( 226 fake_toplevel_onc->GetListWithoutPathExpansion(
227 onc::toplevel_config::kCertificates, &certs); 227 onc::toplevel_config::kCertificates, &certs);
228 AppendAll(*certs, &fake_certificates_); 228 AppendAll(*certs, &fake_certificates_);
229 229
230 certificate_importer_ = new FakeCertificateImporter; 230 certificate_importer_ = new FakeCertificateImporter;
231 certificate_importer_owned_.reset(certificate_importer_); 231 certificate_importer_owned_.reset(certificate_importer_);
232 } 232 }
233 233
234 virtual void TearDown() override { 234 void TearDown() override {
235 network_configuration_updater_.reset(); 235 network_configuration_updater_.reset();
236 provider_.Shutdown(); 236 provider_.Shutdown();
237 base::RunLoop().RunUntilIdle(); 237 base::RunLoop().RunUntilIdle();
238 } 238 }
239 239
240 void MarkPolicyProviderInitialized() { 240 void MarkPolicyProviderInitialized() {
241 Mock::VerifyAndClearExpectations(&provider_); 241 Mock::VerifyAndClearExpectations(&provider_);
242 EXPECT_CALL(provider_, IsInitializationComplete(_)) 242 EXPECT_CALL(provider_, IsInitializationComplete(_))
243 .WillRepeatedly(Return(true)); 243 .WillRepeatedly(Return(true));
244 provider_.SetAutoRefresh(); 244 provider_.SetAutoRefresh();
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 EXPECT_EQ(ExpectedImportCertificatesCallCount(), 657 EXPECT_EQ(ExpectedImportCertificatesCallCount(),
658 certificate_importer_->GetAndResetImportCount()); 658 certificate_importer_->GetAndResetImportCount());
659 } 659 }
660 660
661 INSTANTIATE_TEST_CASE_P(NetworkConfigurationUpdaterTestWithParamInstance, 661 INSTANTIATE_TEST_CASE_P(NetworkConfigurationUpdaterTestWithParamInstance,
662 NetworkConfigurationUpdaterTestWithParam, 662 NetworkConfigurationUpdaterTestWithParam,
663 testing::Values(key::kDeviceOpenNetworkConfiguration, 663 testing::Values(key::kDeviceOpenNetworkConfiguration,
664 key::kOpenNetworkConfiguration)); 664 key::kOpenNetworkConfiguration));
665 665
666 } // namespace policy 666 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698