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

Side by Side Diff: chrome/browser/policy/cloud/cloud_policy_browsertest.cc

Issue 385263004: Get rid of some uses of CreateIntegerValue (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | Annotate | Revision Log
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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 NULL); 145 NULL);
146 #endif 146 #endif
147 } 147 }
148 148
149 void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) { 149 void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) {
150 expected->Set(key::kShowHomeButton, 150 expected->Set(key::kShowHomeButton,
151 POLICY_LEVEL_MANDATORY, 151 POLICY_LEVEL_MANDATORY,
152 POLICY_SCOPE_USER, 152 POLICY_SCOPE_USER,
153 new base::FundamentalValue(true), 153 new base::FundamentalValue(true),
154 NULL); 154 NULL);
155 expected->Set(key::kRestoreOnStartup, POLICY_LEVEL_MANDATORY, 155 expected->Set(key::kRestoreOnStartup,
156 POLICY_SCOPE_USER, base::Value::CreateIntegerValue(4), NULL); 156 POLICY_LEVEL_MANDATORY,
157 POLICY_SCOPE_USER,
158 new base::FundamentalValue(4),
159 NULL);
157 base::ListValue list; 160 base::ListValue list;
158 list.AppendString("dev.chromium.org"); 161 list.AppendString("dev.chromium.org");
159 list.AppendString("youtube.com"); 162 list.AppendString("youtube.com");
160 expected->Set( 163 expected->Set(
161 key::kURLBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 164 key::kURLBlacklist, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
162 list.DeepCopy(), NULL); 165 list.DeepCopy(), NULL);
163 expected->Set( 166 expected->Set(key::kMaxInvalidationFetchDelay,
164 key::kMaxInvalidationFetchDelay, POLICY_LEVEL_MANDATORY, 167 POLICY_LEVEL_MANDATORY,
165 POLICY_SCOPE_USER, base::Value::CreateIntegerValue(1000), NULL); 168 POLICY_SCOPE_USER,
169 new base::FundamentalValue(1000),
170 NULL);
166 expected->Set(key::kHomepageLocation, 171 expected->Set(key::kHomepageLocation,
167 POLICY_LEVEL_RECOMMENDED, 172 POLICY_LEVEL_RECOMMENDED,
168 POLICY_SCOPE_USER, 173 POLICY_SCOPE_USER,
169 new base::StringValue(homepage), 174 new base::StringValue(homepage),
170 NULL); 175 NULL);
171 #if defined(OS_CHROMEOS) 176 #if defined(OS_CHROMEOS)
172 expected->Set(key::kChromeOsMultiProfileUserBehavior, 177 expected->Set(key::kChromeOsMultiProfileUserBehavior,
173 POLICY_LEVEL_MANDATORY, 178 POLICY_LEVEL_MANDATORY,
174 POLICY_SCOPE_USER, 179 POLICY_SCOPE_USER,
175 new base::StringValue("primary-only"), 180 new base::StringValue("primary-only"),
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 473
469 // They should now serialize to the same bytes. 474 // They should now serialize to the same bytes.
470 std::string chrome_settings_serialized; 475 std::string chrome_settings_serialized;
471 std::string cloud_policy_serialized; 476 std::string cloud_policy_serialized;
472 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); 477 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized));
473 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); 478 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized));
474 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); 479 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized);
475 } 480 }
476 481
477 } // namespace policy 482 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/plugins/plugin_info_message_filter_unittest.cc ('k') | chrome/browser/policy/javascript_policy_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698