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

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

Issue 1940153002: Use std::unique_ptr to express ownership of base::Value in PolicyMap::Entry (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another-fix Created 4 years, 7 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_loader_mac.h" 5 #include "components/policy/core/common/policy_loader_mac.h"
6 6
7 #include <CoreFoundation/CoreFoundation.h> 7 #include <CoreFoundation/CoreFoundation.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
13 #include "base/mac/scoped_cftyperef.h" 13 #include "base/mac/scoped_cftyperef.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/ptr_util.h"
15 #include "base/strings/sys_string_conversions.h" 16 #include "base/strings/sys_string_conversions.h"
16 #include "base/values.h" 17 #include "base/values.h"
17 #include "components/policy/core/common/async_policy_provider.h" 18 #include "components/policy/core/common/async_policy_provider.h"
18 #include "components/policy/core/common/configuration_policy_provider_test.h" 19 #include "components/policy/core/common/configuration_policy_provider_test.h"
19 #include "components/policy/core/common/external_data_fetcher.h" 20 #include "components/policy/core/common/external_data_fetcher.h"
20 #include "components/policy/core/common/policy_bundle.h" 21 #include "components/policy/core/common/policy_bundle.h"
21 #include "components/policy/core/common/policy_map.h" 22 #include "components/policy/core/common/policy_map.h"
22 #include "components/policy/core/common/policy_test_utils.h" 23 #include "components/policy/core/common/policy_test_utils.h"
23 #include "components/policy/core/common/policy_types.h" 24 #include "components/policy/core/common/policy_types.h"
24 #include "components/policy/core/common/preferences_mock_mac.h" 25 #include "components/policy/core/common/preferences_mock_mac.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 ScopedCFTypeRef<CFPropertyListRef> test_value( 187 ScopedCFTypeRef<CFPropertyListRef> test_value(
187 base::SysUTF8ToCFStringRef("string value")); 188 base::SysUTF8ToCFStringRef("string value"));
188 ASSERT_TRUE(test_value.get()); 189 ASSERT_TRUE(test_value.get());
189 prefs_->AddTestItem(name, test_value.get(), false); 190 prefs_->AddTestItem(name, test_value.get(), false);
190 191
191 // Make the provider read the updated |prefs_|. 192 // Make the provider read the updated |prefs_|.
192 provider_->RefreshPolicies(); 193 provider_->RefreshPolicies();
193 loop_.RunUntilIdle(); 194 loop_.RunUntilIdle();
194 PolicyBundle expected_bundle; 195 PolicyBundle expected_bundle;
195 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())) 196 expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
196 .Set(test_keys::kKeyString, 197 .Set(test_keys::kKeyString, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
197 POLICY_LEVEL_RECOMMENDED,
198 POLICY_SCOPE_USER,
199 POLICY_SOURCE_PLATFORM, 198 POLICY_SOURCE_PLATFORM,
200 new base::StringValue("string value"), 199 base::WrapUnique(new base::StringValue("string value")), nullptr);
201 NULL);
202 EXPECT_TRUE(provider_->policies().Equals(expected_bundle)); 200 EXPECT_TRUE(provider_->policies().Equals(expected_bundle));
203 } 201 }
204 202
205 } // namespace policy 203 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_loader_mac.mm ('k') | components/policy/core/common/policy_loader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698