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

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

Issue 116273002: Added support for signed policy blobs on desktop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup from self-review + cros clang fix. Created 6 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 | Annotate | Revision Log
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/base64.h" 7 #include "base/base64.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 ASSERT_TRUE(signin_manager); 179 ASSERT_TRUE(signin_manager);
180 signin_manager->SetAuthenticatedUsername("user@example.com"); 180 signin_manager->SetAuthenticatedUsername("user@example.com");
181 181
182 UserCloudPolicyManager* policy_manager = 182 UserCloudPolicyManager* policy_manager =
183 UserCloudPolicyManagerFactory::GetForBrowserContext( 183 UserCloudPolicyManagerFactory::GetForBrowserContext(
184 browser()->profile()); 184 browser()->profile());
185 ASSERT_TRUE(policy_manager); 185 ASSERT_TRUE(policy_manager);
186 policy_manager->Connect( 186 policy_manager->Connect(
187 g_browser_process->local_state(), 187 g_browser_process->local_state(),
188 g_browser_process->system_request_context(), 188 g_browser_process->system_request_context(),
189 UserCloudPolicyManager::CreateCloudPolicyClient( 189 policy_manager->CreateCloudPolicyClient(
190 connector->device_management_service(), 190 connector->device_management_service(),
191 g_browser_process->system_request_context()).Pass()); 191 g_browser_process->system_request_context()).Pass());
192 #endif // defined(OS_CHROMEOS) 192 #endif // defined(OS_CHROMEOS)
193 193
194 // Register the cloud policy client. 194 // Register the cloud policy client.
195 ASSERT_TRUE(policy_manager->core()->client()); 195 ASSERT_TRUE(policy_manager->core()->client());
196 base::RunLoop run_loop; 196 base::RunLoop run_loop;
197 MockCloudPolicyClientObserver observer; 197 MockCloudPolicyClientObserver observer;
198 EXPECT_CALL(observer, OnRegistrationStateChanged(_)) 198 EXPECT_CALL(observer, OnRegistrationStateChanged(_))
199 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit)); 199 .WillOnce(InvokeWithoutArgs(&run_loop, &base::RunLoop::Quit));
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true); 328 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true);
329 event_listener2.Reply("get-policy-Name"); 329 event_listener2.Reply("get-policy-Name");
330 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied()); 330 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied());
331 331
332 // And the cache is back. 332 // And the cache is back.
333 EXPECT_TRUE(base::PathExists(cache_path)); 333 EXPECT_TRUE(base::PathExists(cache_path));
334 } 334 }
335 #endif 335 #endif
336 336
337 } // namespace policy 337 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698