| OLD | NEW |
| 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/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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 UserCloudPolicyManagerChromeOS* policy_manager = | 175 UserCloudPolicyManagerChromeOS* policy_manager = |
| 176 UserCloudPolicyManagerFactoryChromeOS::GetForProfile( | 176 UserCloudPolicyManagerFactoryChromeOS::GetForProfile( |
| 177 browser()->profile()); | 177 browser()->profile()); |
| 178 ASSERT_TRUE(policy_manager); | 178 ASSERT_TRUE(policy_manager); |
| 179 #else | 179 #else |
| 180 // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass | 180 // Mock a signed-in user. This is used by the UserCloudPolicyStore to pass |
| 181 // the username to the UserCloudPolicyValidator. | 181 // the username to the UserCloudPolicyValidator. |
| 182 SigninManager* signin_manager = | 182 SigninManager* signin_manager = |
| 183 SigninManagerFactory::GetForProfile(browser()->profile()); | 183 SigninManagerFactory::GetForProfile(browser()->profile()); |
| 184 ASSERT_TRUE(signin_manager); | 184 ASSERT_TRUE(signin_manager); |
| 185 signin_manager->SetAuthenticatedUsername("user@example.com"); | 185 signin_manager->SetAuthenticatedAccountInfo("12345", "user@example.com"); |
| 186 | 186 |
| 187 UserCloudPolicyManager* policy_manager = | 187 UserCloudPolicyManager* policy_manager = |
| 188 UserCloudPolicyManagerFactory::GetForBrowserContext( | 188 UserCloudPolicyManagerFactory::GetForBrowserContext( |
| 189 browser()->profile()); | 189 browser()->profile()); |
| 190 ASSERT_TRUE(policy_manager); | 190 ASSERT_TRUE(policy_manager); |
| 191 policy_manager->Connect( | 191 policy_manager->Connect( |
| 192 g_browser_process->local_state(), | 192 g_browser_process->local_state(), |
| 193 g_browser_process->system_request_context(), | 193 g_browser_process->system_request_context(), |
| 194 UserCloudPolicyManager::CreateCloudPolicyClient( | 194 UserCloudPolicyManager::CreateCloudPolicyClient( |
| 195 connector->device_management_service(), | 195 connector->device_management_service(), |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true); | 339 ExtensionTestMessageListener signin_policy_listener(kTestPolicyJSON, true); |
| 340 event_listener2.Reply("get-policy-Name"); | 340 event_listener2.Reply("get-policy-Name"); |
| 341 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied()); | 341 EXPECT_TRUE(signin_policy_listener.WaitUntilSatisfied()); |
| 342 | 342 |
| 343 // And the cache is back. | 343 // And the cache is back. |
| 344 EXPECT_TRUE(base::PathExists(cache_path)); | 344 EXPECT_TRUE(base::PathExists(cache_path)); |
| 345 } | 345 } |
| 346 #endif | 346 #endif |
| 347 | 347 |
| 348 } // namespace policy | 348 } // namespace policy |
| OLD | NEW |