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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 (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 <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 " values.push(item.textContent);" 152 " values.push(item.textContent);"
153 " }" 153 " }"
154 " policies.push(values);" 154 " policies.push(values);"
155 "}" 155 "}"
156 "domAutomationController.send(JSON.stringify(policies));"; 156 "domAutomationController.send(JSON.stringify(policies));";
157 content::WebContents* contents = 157 content::WebContents* contents =
158 browser()->tab_strip_model()->GetActiveWebContents(); 158 browser()->tab_strip_model()->GetActiveWebContents();
159 std::string json; 159 std::string json;
160 ASSERT_TRUE(content::ExecuteScriptAndExtractString(contents, javascript, 160 ASSERT_TRUE(content::ExecuteScriptAndExtractString(contents, javascript,
161 &json)); 161 &json));
162 scoped_ptr<base::Value> value_ptr = base::JSONReader::Read(json); 162 std::unique_ptr<base::Value> value_ptr = base::JSONReader::Read(json);
163 const base::ListValue* actual_policies = NULL; 163 const base::ListValue* actual_policies = NULL;
164 ASSERT_TRUE(value_ptr.get()); 164 ASSERT_TRUE(value_ptr.get());
165 ASSERT_TRUE(value_ptr->GetAsList(&actual_policies)); 165 ASSERT_TRUE(value_ptr->GetAsList(&actual_policies));
166 166
167 // Verify that the cells contain the expected strings for all policies. 167 // Verify that the cells contain the expected strings for all policies.
168 ASSERT_EQ(expected_policies.size(), actual_policies->GetSize()); 168 ASSERT_EQ(expected_policies.size(), actual_policies->GetSize());
169 for (size_t i = 0; i < expected_policies.size(); ++i) { 169 for (size_t i = 0; i < expected_policies.size(); ++i) {
170 const std::vector<std::string> expected_policy = expected_policies[i]; 170 const std::vector<std::string> expected_policy = expected_policies[i];
171 const base::ListValue* actual_policy; 171 const base::ListValue* actual_policy;
172 ASSERT_TRUE(actual_policies->GetList(i, &actual_policy)); 172 ASSERT_TRUE(actual_policies->GetList(i, &actual_policy));
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 PopulateExpectedPolicy( 336 PopulateExpectedPolicy(
337 it.key(), std::string(), std::string(), nullptr, false)); 337 it.key(), std::string(), std::string(), nullptr, false));
338 } 338 }
339 // Add newly added policy to expected policy list. 339 // Add newly added policy to expected policy list.
340 expected_policies.push_back(PopulateExpectedPolicy( 340 expected_policies.push_back(PopulateExpectedPolicy(
341 newly_added_policy_name, std::string(), std::string(), nullptr, false)); 341 newly_added_policy_name, std::string(), std::string(), nullptr, false));
342 342
343 // Verify if policy UI includes policy that extension have. 343 // Verify if policy UI includes policy that extension have.
344 VerifyPolicies(expected_policies); 344 VerifyPolicies(expected_policies);
345 } 345 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/policy_material_design_ui.cc ('k') | chrome/browser/ui/webui/policy_ui_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698