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

Side by Side Diff: components/policy/core/browser/proxy_policy_handler_unittest.cc

Issue 1902633006: Convert //components/policy from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and use namespace alias Created 4 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 "components/policy/core/browser/proxy_policy_handler.h"
6
7 #include <memory>
5 #include <string> 8 #include <string>
6 9
7 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/ptr_util.h"
8 #include "base/values.h" 11 #include "base/values.h"
9 #include "components/policy/core/browser/configuration_policy_pref_store.h" 12 #include "components/policy/core/browser/configuration_policy_pref_store.h"
10 #include "components/policy/core/browser/configuration_policy_pref_store_test.h" 13 #include "components/policy/core/browser/configuration_policy_pref_store_test.h"
11 #include "components/policy/core/browser/proxy_policy_handler.h"
12 #include "components/policy/core/common/policy_service_impl.h" 14 #include "components/policy/core/common/policy_service_impl.h"
13 #include "components/policy/core/common/policy_types.h" 15 #include "components/policy/core/common/policy_types.h"
14 #include "components/proxy_config/proxy_config_dictionary.h" 16 #include "components/proxy_config/proxy_config_dictionary.h"
15 #include "components/proxy_config/proxy_config_pref_names.h" 17 #include "components/proxy_config/proxy_config_pref_names.h"
16 #include "policy/policy_constants.h" 18 #include "policy/policy_constants.h"
17 #include "testing/gtest/include/gtest/gtest.h" 19 #include "testing/gtest/include/gtest/gtest.h"
18 20
19 namespace policy { 21 namespace policy {
20 22
21 // Test cases for the proxy policy settings. 23 // Test cases for the proxy policy settings.
22 class ProxyPolicyHandlerTest 24 class ProxyPolicyHandlerTest
23 : public ConfigurationPolicyPrefStoreTest { 25 : public ConfigurationPolicyPrefStoreTest {
24 public: 26 public:
25 void SetUp() override { 27 void SetUp() override {
26 ConfigurationPolicyPrefStoreTest::SetUp(); 28 ConfigurationPolicyPrefStoreTest::SetUp();
27 handler_list_.AddHandler( 29 handler_list_.AddHandler(
28 make_scoped_ptr<ConfigurationPolicyHandler>(new ProxyPolicyHandler)); 30 base::WrapUnique<ConfigurationPolicyHandler>(new ProxyPolicyHandler));
29 // Reset the PolicyServiceImpl to one that has the policy fixup 31 // Reset the PolicyServiceImpl to one that has the policy fixup
30 // preprocessor. The previous store must be nulled out first so that it 32 // preprocessor. The previous store must be nulled out first so that it
31 // removes itself from the service's observer list. 33 // removes itself from the service's observer list.
32 store_ = NULL; 34 store_ = NULL;
33 policy_service_.reset(new PolicyServiceImpl(providers_)); 35 policy_service_.reset(new PolicyServiceImpl(providers_));
34 store_ = new ConfigurationPolicyPrefStore( 36 store_ = new ConfigurationPolicyPrefStore(
35 policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY); 37 policy_service_.get(), &handler_list_, POLICY_LEVEL_MANDATORY);
36 } 38 }
37 39
38 protected: 40 protected:
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 POLICY_SOURCE_CLOUD, 347 POLICY_SOURCE_CLOUD,
346 new base::FundamentalValue(i), 348 new base::FundamentalValue(i),
347 NULL); 349 NULL);
348 UpdateProviderPolicy(policy); 350 UpdateProviderPolicy(policy);
349 const base::Value* value = NULL; 351 const base::Value* value = NULL;
350 EXPECT_FALSE(store_->GetValue(proxy_config::prefs::kProxy, &value)); 352 EXPECT_FALSE(store_->GetValue(proxy_config::prefs::kProxy, &value));
351 } 353 }
352 } 354 }
353 355
354 } // namespace policy 356 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/browser/proxy_policy_handler.cc ('k') | components/policy/core/browser/url_blacklist_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698