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

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

Issue 499923002: Revert "Set default multi-profile policy to not-allowed." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc ('k') | no next file » | 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 "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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 homepage, 133 homepage,
134 GetTestUser(), 134 GetTestUser(),
135 key_version); 135 key_version);
136 } 136 }
137 137
138 void GetExpectedDefaultPolicy(PolicyMap* policy_map) { 138 void GetExpectedDefaultPolicy(PolicyMap* policy_map) {
139 #if defined(OS_CHROMEOS) 139 #if defined(OS_CHROMEOS)
140 policy_map->Set(key::kChromeOsMultiProfileUserBehavior, 140 policy_map->Set(key::kChromeOsMultiProfileUserBehavior,
141 POLICY_LEVEL_MANDATORY, 141 POLICY_LEVEL_MANDATORY,
142 POLICY_SCOPE_USER, 142 POLICY_SCOPE_USER,
143 new base::StringValue("not-allowed"), 143 new base::StringValue("primary-only"),
144 NULL); 144 NULL);
145 #endif 145 #endif
146 } 146 }
147 147
148 void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) { 148 void GetExpectedTestPolicy(PolicyMap* expected, const char* homepage) {
149 expected->Set(key::kShowHomeButton, 149 expected->Set(key::kShowHomeButton,
150 POLICY_LEVEL_MANDATORY, 150 POLICY_LEVEL_MANDATORY,
151 POLICY_SCOPE_USER, 151 POLICY_SCOPE_USER,
152 new base::FundamentalValue(true), 152 new base::FundamentalValue(true),
153 NULL); 153 NULL);
(...skipping 15 matching lines...) Expand all
169 NULL); 169 NULL);
170 expected->Set(key::kHomepageLocation, 170 expected->Set(key::kHomepageLocation,
171 POLICY_LEVEL_RECOMMENDED, 171 POLICY_LEVEL_RECOMMENDED,
172 POLICY_SCOPE_USER, 172 POLICY_SCOPE_USER,
173 new base::StringValue(homepage), 173 new base::StringValue(homepage),
174 NULL); 174 NULL);
175 #if defined(OS_CHROMEOS) 175 #if defined(OS_CHROMEOS)
176 expected->Set(key::kChromeOsMultiProfileUserBehavior, 176 expected->Set(key::kChromeOsMultiProfileUserBehavior,
177 POLICY_LEVEL_MANDATORY, 177 POLICY_LEVEL_MANDATORY,
178 POLICY_SCOPE_USER, 178 POLICY_SCOPE_USER,
179 new base::StringValue("not-allowed"), 179 new base::StringValue("primary-only"),
180 NULL); 180 NULL);
181 #endif 181 #endif
182 } 182 }
183 183
184 } // namespace 184 } // namespace
185 185
186 // Tests the cloud policy stack(s). 186 // Tests the cloud policy stack(s).
187 class CloudPolicyTest : public InProcessBrowserTest, 187 class CloudPolicyTest : public InProcessBrowserTest,
188 public PolicyService::Observer { 188 public PolicyService::Observer {
189 protected: 189 protected:
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 472
473 // They should now serialize to the same bytes. 473 // They should now serialize to the same bytes.
474 std::string chrome_settings_serialized; 474 std::string chrome_settings_serialized;
475 std::string cloud_policy_serialized; 475 std::string cloud_policy_serialized;
476 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized)); 476 ASSERT_TRUE(chrome_settings.SerializeToString(&chrome_settings_serialized));
477 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized)); 477 ASSERT_TRUE(cloud_policy.SerializeToString(&cloud_policy_serialized));
478 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized); 478 EXPECT_EQ(chrome_settings_serialized, cloud_policy_serialized);
479 } 479 }
480 480
481 } // namespace policy 481 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698