| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/chromeos/login/multi_profile_user_controller.h" | 5 #include "chrome/browser/chromeos/login/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/fake_user_manager.h" | 10 #include "chrome/browser/chromeos/login/fake_user_manager.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 void SetCachedBehavior(size_t user_index, | 169 void SetCachedBehavior(size_t user_index, |
| 170 const std::string& behavior) { | 170 const std::string& behavior) { |
| 171 controller_->SetCachedValue(kUsers[user_index], behavior); | 171 controller_->SetCachedValue(kUsers[user_index], behavior); |
| 172 } | 172 } |
| 173 | 173 |
| 174 void ResetCounts() { | 174 void ResetCounts() { |
| 175 user_not_allowed_count_ = 0; | 175 user_not_allowed_count_ = 0; |
| 176 } | 176 } |
| 177 | 177 |
| 178 // MultiProfileUserControllerDeleagte overrides: | 178 // MultiProfileUserControllerDeleagte overrides: |
| 179 virtual void OnUserNotAllowed() OVERRIDE { | 179 virtual void OnUserNotAllowed(const std::string& user_email) OVERRIDE { |
| 180 ++user_not_allowed_count_; | 180 ++user_not_allowed_count_; |
| 181 } | 181 } |
| 182 | 182 |
| 183 MultiProfileUserController* controller() { return controller_.get(); } | 183 MultiProfileUserController* controller() { return controller_.get(); } |
| 184 int user_not_allowed_count() const { return user_not_allowed_count_; } | 184 int user_not_allowed_count() const { return user_not_allowed_count_; } |
| 185 | 185 |
| 186 TestingProfile* profile(int index) { | 186 TestingProfile* profile(int index) { |
| 187 return user_profiles_[index]; | 187 return user_profiles_[index]; |
| 188 } | 188 } |
| 189 | 189 |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 "subject", "issuer", base::Time(), base::Time())); | 375 "subject", "issuer", base::Time(), base::Time())); |
| 376 service->OnTrustAnchorsChanged(certificates); | 376 service->OnTrustAnchorsChanged(certificates); |
| 377 EXPECT_TRUE(service->has_policy_certificates()); | 377 EXPECT_TRUE(service->has_policy_certificates()); |
| 378 EXPECT_FALSE(controller()->IsUserAllowedInSession(kUsers[1])); | 378 EXPECT_FALSE(controller()->IsUserAllowedInSession(kUsers[1])); |
| 379 | 379 |
| 380 // Flush tasks posted to IO. | 380 // Flush tasks posted to IO. |
| 381 base::RunLoop().RunUntilIdle(); | 381 base::RunLoop().RunUntilIdle(); |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace chromeos | 384 } // namespace chromeos |
| OLD | NEW |