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

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

Issue 2606773002: Setup Chromad user policy plumbing (Closed)
Patch Set: CrOS compilation fix Created 3 years, 11 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 <string> 5 #include <string>
6 6
7 #include "base/base64url.h" 7 #include "base/base64url.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return extension; 163 return extension;
164 } 164 }
165 165
166 void SignInAndRegister() { 166 void SignInAndRegister() {
167 BrowserPolicyConnector* connector = 167 BrowserPolicyConnector* connector =
168 g_browser_process->browser_policy_connector(); 168 g_browser_process->browser_policy_connector();
169 connector->ScheduleServiceInitialization(0); 169 connector->ScheduleServiceInitialization(0);
170 170
171 #if defined(OS_CHROMEOS) 171 #if defined(OS_CHROMEOS)
172 UserCloudPolicyManagerChromeOS* policy_manager = 172 UserCloudPolicyManagerChromeOS* policy_manager =
173 UserCloudPolicyManagerFactoryChromeOS::GetForProfile( 173 UserCloudPolicyManagerFactoryChromeOS::GetCloudPolicyManagerForProfile(
174 browser()->profile()); 174 browser()->profile());
175 ASSERT_TRUE(policy_manager); 175 ASSERT_TRUE(policy_manager);
176 #else 176 #else
177 // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass 177 // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass
178 // the username to the UserCloudPolicyValidator. 178 // the username to the UserCloudPolicyValidator.
179 SigninManager* signin_manager = 179 SigninManager* signin_manager =
180 SigninManagerFactory::GetForProfile(browser()->profile()); 180 SigninManagerFactory::GetForProfile(browser()->profile());
181 ASSERT_TRUE(signin_manager); 181 ASSERT_TRUE(signin_manager);
182 signin_manager->SetAuthenticatedAccountInfo("12345", 182 signin_manager->SetAuthenticatedAccountInfo("12345",
183 PolicyBuilder::kFakeUsername); 183 PolicyBuilder::kFakeUsername);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 ExtensionTestMessageListener policy_listener1("{}", true); 402 ExtensionTestMessageListener policy_listener1("{}", true);
403 event_listener_->Reply("get-policy-Name"); 403 event_listener_->Reply("get-policy-Name");
404 EXPECT_TRUE(policy_listener1.WaitUntilSatisfied()); 404 EXPECT_TRUE(policy_listener1.WaitUntilSatisfied());
405 405
406 ExtensionTestMessageListener policy_listener2(kTestPolicy2JSON, false); 406 ExtensionTestMessageListener policy_listener2(kTestPolicy2JSON, false);
407 policy_listener1.Reply("get-policy-Another"); 407 policy_listener1.Reply("get-policy-Another");
408 EXPECT_TRUE(policy_listener2.WaitUntilSatisfied()); 408 EXPECT_TRUE(policy_listener2.WaitUntilSatisfied());
409 } 409 }
410 410
411 } // namespace policy 411 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698