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

Side by Side Diff: components/policy/core/common/policy_service_impl_unittest.cc

Issue 666133002: Standardize usage of virtual/override/final in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 (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 "components/policy/core/common/policy_service_impl.h" 5 #include "components/policy/core/common/policy_service_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 68 }
69 69
70 // Observer class that changes the policy in the passed provider when the 70 // Observer class that changes the policy in the passed provider when the
71 // callback is invoked. 71 // callback is invoked.
72 class ChangePolicyObserver : public PolicyService::Observer { 72 class ChangePolicyObserver : public PolicyService::Observer {
73 public: 73 public:
74 explicit ChangePolicyObserver(MockConfigurationPolicyProvider* provider) 74 explicit ChangePolicyObserver(MockConfigurationPolicyProvider* provider)
75 : provider_(provider), 75 : provider_(provider),
76 observer_invoked_(false) {} 76 observer_invoked_(false) {}
77 77
78 virtual void OnPolicyUpdated(const PolicyNamespace&, 78 void OnPolicyUpdated(const PolicyNamespace&,
79 const PolicyMap& previous, 79 const PolicyMap& previous,
80 const PolicyMap& current) override { 80 const PolicyMap& current) override {
81 PolicyMap new_policy; 81 PolicyMap new_policy;
82 new_policy.Set("foo", 82 new_policy.Set("foo",
83 POLICY_LEVEL_MANDATORY, 83 POLICY_LEVEL_MANDATORY,
84 POLICY_SCOPE_USER, 84 POLICY_SCOPE_USER,
85 new base::FundamentalValue(14), 85 new base::FundamentalValue(14),
86 NULL); 86 NULL);
87 provider_->UpdateChromePolicy(new_policy); 87 provider_->UpdateChromePolicy(new_policy);
88 observer_invoked_ = true; 88 observer_invoked_ = true;
89 } 89 }
90 90
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 NULL); 733 NULL);
734 734
735 provider0_.UpdatePolicy(policy_bundle.Pass()); 735 provider0_.UpdatePolicy(policy_bundle.Pass());
736 RunUntilIdle(); 736 RunUntilIdle();
737 737
738 EXPECT_TRUE(VerifyPolicies(chrome_namespace, expected_chrome)); 738 EXPECT_TRUE(VerifyPolicies(chrome_namespace, expected_chrome));
739 EXPECT_TRUE(VerifyPolicies(extension_namespace, expected_extension)); 739 EXPECT_TRUE(VerifyPolicies(extension_namespace, expected_extension));
740 } 740 }
741 741
742 } // namespace policy 742 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_service_impl.h ('k') | components/policy/core/common/preferences_mock_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698