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

Side by Side Diff: chrome/browser/ui/webui/policy_ui_browsertest.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyValues) { 208 IN_PROC_BROWSER_TEST_F(PolicyUITest, SendPolicyValues) {
209 // Verifies that policy values are sent to the UI and processed there 209 // Verifies that policy values are sent to the UI and processed there
210 // correctly by setting the values of four known and one unknown policy and 210 // correctly by setting the values of four known and one unknown policy and
211 // checking that the policy table contains the policy names, values and 211 // checking that the policy table contains the policy names, values and
212 // metadata in the correct order. 212 // metadata in the correct order.
213 policy::PolicyMap values; 213 policy::PolicyMap values;
214 std::map<std::string, std::string> expected_values; 214 std::map<std::string, std::string> expected_values;
215 215
216 // Set the values of four existing policies. 216 // Set the values of four existing policies.
217 std::unique_ptr<base::ListValue> restore_on_startup_urls(new base::ListValue); 217 std::unique_ptr<base::ListValue> restore_on_startup_urls(new base::ListValue);
218 restore_on_startup_urls->Append(new base::StringValue("aaa")); 218 restore_on_startup_urls->AppendString("aaa");
219 restore_on_startup_urls->Append(new base::StringValue("bbb")); 219 restore_on_startup_urls->AppendString("bbb");
220 restore_on_startup_urls->Append(new base::StringValue("ccc")); 220 restore_on_startup_urls->AppendString("ccc");
221 values.Set(policy::key::kRestoreOnStartupURLs, policy::POLICY_LEVEL_MANDATORY, 221 values.Set(policy::key::kRestoreOnStartupURLs, policy::POLICY_LEVEL_MANDATORY,
222 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD, 222 policy::POLICY_SCOPE_USER, policy::POLICY_SOURCE_CLOUD,
223 std::move(restore_on_startup_urls), nullptr); 223 std::move(restore_on_startup_urls), nullptr);
224 expected_values[policy::key::kRestoreOnStartupURLs] = "aaa,bbb,ccc"; 224 expected_values[policy::key::kRestoreOnStartupURLs] = "aaa,bbb,ccc";
225 values.Set(policy::key::kHomepageLocation, policy::POLICY_LEVEL_MANDATORY, 225 values.Set(policy::key::kHomepageLocation, policy::POLICY_LEVEL_MANDATORY,
226 policy::POLICY_SCOPE_MACHINE, policy::POLICY_SOURCE_CLOUD, 226 policy::POLICY_SCOPE_MACHINE, policy::POLICY_SOURCE_CLOUD,
227 base::WrapUnique(new base::StringValue("http://google.com")), 227 base::WrapUnique(new base::StringValue("http://google.com")),
228 nullptr); 228 nullptr);
229 expected_values[policy::key::kHomepageLocation] = "http://google.com"; 229 expected_values[policy::key::kHomepageLocation] = "http://google.com";
230 values.Set(policy::key::kRestoreOnStartup, policy::POLICY_LEVEL_RECOMMENDED, 230 values.Set(policy::key::kRestoreOnStartup, policy::POLICY_LEVEL_RECOMMENDED,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 PopulateExpectedPolicy( 325 PopulateExpectedPolicy(
326 it.key(), std::string(), std::string(), nullptr, false)); 326 it.key(), std::string(), std::string(), nullptr, false));
327 } 327 }
328 // Add newly added policy to expected policy list. 328 // Add newly added policy to expected policy list.
329 expected_policies.push_back(PopulateExpectedPolicy( 329 expected_policies.push_back(PopulateExpectedPolicy(
330 newly_added_policy_name, std::string(), std::string(), nullptr, false)); 330 newly_added_policy_name, std::string(), std::string(), nullptr, false));
331 331
332 // Verify if policy UI includes policy that extension have. 332 // Verify if policy UI includes policy that extension have.
333 VerifyPolicies(expected_policies); 333 VerifyPolicies(expected_policies);
334 } 334 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/sync_setup_handler_unittest.cc ('k') | chrome/browser/ui/webui/settings/font_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698