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

Side by Side Diff: chrome/browser/policy/policy_loader_win_unittest.cc

Issue 10837044: Correct const accessors in base/values.(h|cc), Part II (ListValue) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: David's comments Created 8 years, 4 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
« no previous file with comments | « chrome/browser/net/predictor_unittest.cc ('k') | chrome/browser/printing/print_job_worker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/policy/policy_loader_win.h" 5 #include "chrome/browser/policy/policy_loader_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 } 89 }
90 return true; 90 return true;
91 } 91 }
92 92
93 case base::Value::TYPE_LIST: { 93 case base::Value::TYPE_LIST: {
94 const base::ListValue* list = NULL; 94 const base::ListValue* list = NULL;
95 if (!value.GetAsList(&list)) 95 if (!value.GetAsList(&list))
96 return false; 96 return false;
97 for (size_t i = 0; i < list->GetSize(); ++i) { 97 for (size_t i = 0; i < list->GetSize(); ++i) {
98 base::Value* item; 98 const base::Value* item;
99 if (!list->Get(i, &item)) 99 if (!list->Get(i, &item))
100 return false; 100 return false;
101 if (!InstallValue(*item, hive, path + kPathSep + name, 101 if (!InstallValue(*item, hive, path + kPathSep + name,
102 base::UintToString16(i + 1))) { 102 base::UintToString16(i + 1))) {
103 return false; 103 return false;
104 } 104 }
105 } 105 }
106 return true; 106 return true;
107 } 107 }
108 108
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 expected_policy.SetInteger("special-int2", -456); 607 expected_policy.SetInteger("special-int2", -456);
608 expected_policy.SetDouble("double1", 789.0); 608 expected_policy.SetDouble("double1", 789.0);
609 expected_policy.SetDouble("double2", 123.456e7); 609 expected_policy.SetDouble("double2", 123.456e7);
610 PolicyBundle expected; 610 PolicyBundle expected;
611 expected.Get(POLICY_DOMAIN_EXTENSIONS, "test") 611 expected.Get(POLICY_DOMAIN_EXTENSIONS, "test")
612 .LoadFrom(&expected_policy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); 612 .LoadFrom(&expected_policy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER);
613 EXPECT_TRUE(Matches(expected)); 613 EXPECT_TRUE(Matches(expected));
614 } 614 }
615 615
616 } // namespace policy 616 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/net/predictor_unittest.cc ('k') | chrome/browser/printing/print_job_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698