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

Side by Side Diff: chrome/browser/extensions/api/certificate_provider/certificate_provider_apitest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <openssl/evp.h> 5 #include <openssl/evp.h>
6 #include <openssl/rsa.h> 6 #include <openssl/rsa.h>
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // certificate selection dialog. 139 // certificate selection dialog.
140 const std::string autoselect_pattern = 140 const std::string autoselect_pattern =
141 "{\"pattern\": \"*\", \"filter\": {\"ISSUER\": {\"CN\": \"root\"}}}"; 141 "{\"pattern\": \"*\", \"filter\": {\"ISSUER\": {\"CN\": \"root\"}}}";
142 142
143 std::unique_ptr<base::ListValue> autoselect_policy(new base::ListValue); 143 std::unique_ptr<base::ListValue> autoselect_policy(new base::ListValue);
144 autoselect_policy->AppendString(autoselect_pattern); 144 autoselect_policy->AppendString(autoselect_pattern);
145 145
146 policy::PolicyMap policy; 146 policy::PolicyMap policy;
147 policy.Set(policy::key::kAutoSelectCertificateForUrls, 147 policy.Set(policy::key::kAutoSelectCertificateForUrls,
148 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, 148 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER,
149 policy::POLICY_SOURCE_CLOUD, autoselect_policy.release(), 149 policy::POLICY_SOURCE_CLOUD, std::move(autoselect_policy),
150 nullptr); 150 nullptr);
151 provider_.UpdateChromePolicy(policy); 151 provider_.UpdateChromePolicy(policy);
152 152
153 content::RunAllPendingInMessageLoop(); 153 content::RunAllPendingInMessageLoop();
154 } 154 }
155 155
156 protected: 156 protected:
157 policy::MockConfigurationPolicyProvider provider_; 157 policy::MockConfigurationPolicyProvider provider_;
158 }; 158 };
159 159
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 base::RunLoop run_loop; 260 base::RunLoop run_loop;
261 const std::string code = "replyWithSignatureSecondTime();"; 261 const std::string code = "replyWithSignatureSecondTime();";
262 bool result = false; 262 bool result = false;
263 extension_contents->GetMainFrame()->ExecuteJavaScriptForTests( 263 extension_contents->GetMainFrame()->ExecuteJavaScriptForTests(
264 base::ASCIIToUTF16(code), 264 base::ASCIIToUTF16(code),
265 base::Bind(&StoreBool, &result, run_loop.QuitClosure())); 265 base::Bind(&StoreBool, &result, run_loop.QuitClosure()));
266 run_loop.Run(); 266 run_loop.Run();
267 EXPECT_TRUE(result); 267 EXPECT_TRUE(result);
268 } 268 }
269 } 269 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698