OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 5 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" | 10 #include "chrome/browser/chromeos/login/users/fake_user_manager.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 MultiProfileUserController::NOT_ALLOWED_PRIMARY_USER_POLICY_FORBIDS, | 84 MultiProfileUserController::NOT_ALLOWED_PRIMARY_USER_POLICY_FORBIDS, |
85 }, | 85 }, |
86 }; | 86 }; |
87 | 87 |
88 // Weak ptr to PolicyCertVerifier - object is freed in test destructor once | 88 // Weak ptr to PolicyCertVerifier - object is freed in test destructor once |
89 // we've ensured the profile has been shut down. | 89 // we've ensured the profile has been shut down. |
90 policy::PolicyCertVerifier* g_policy_cert_verifier_for_factory = NULL; | 90 policy::PolicyCertVerifier* g_policy_cert_verifier_for_factory = NULL; |
91 | 91 |
92 KeyedService* TestPolicyCertServiceFactory(content::BrowserContext* context) { | 92 KeyedService* TestPolicyCertServiceFactory(content::BrowserContext* context) { |
93 return policy::PolicyCertService::CreateForTesting( | 93 return policy::PolicyCertService::CreateForTesting( |
94 kUsers[0], g_policy_cert_verifier_for_factory, UserManager::Get()) | 94 kUsers[0], g_policy_cert_verifier_for_factory, GetUserManager()) |
95 .release(); | 95 .release(); |
96 } | 96 } |
97 | 97 |
98 } // namespace | 98 } // namespace |
99 | 99 |
100 class MultiProfileUserControllerTest | 100 class MultiProfileUserControllerTest |
101 : public testing::Test, | 101 : public testing::Test, |
102 public MultiProfileUserControllerDelegate { | 102 public MultiProfileUserControllerDelegate { |
103 public: | 103 public: |
104 MultiProfileUserControllerTest() | 104 MultiProfileUserControllerTest() |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 service->OnTrustAnchorsChanged(certificates); | 393 service->OnTrustAnchorsChanged(certificates); |
394 EXPECT_TRUE(service->has_policy_certificates()); | 394 EXPECT_TRUE(service->has_policy_certificates()); |
395 EXPECT_EQ(MultiProfileUserController::NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED, | 395 EXPECT_EQ(MultiProfileUserController::NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED, |
396 controller()->IsUserAllowedInSession(kUsers[1])); | 396 controller()->IsUserAllowedInSession(kUsers[1])); |
397 | 397 |
398 // Flush tasks posted to IO. | 398 // Flush tasks posted to IO. |
399 base::RunLoop().RunUntilIdle(); | 399 base::RunLoop().RunUntilIdle(); |
400 } | 400 } |
401 | 401 |
402 } // namespace chromeos | 402 } // namespace chromeos |
OLD | NEW |