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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 << "Case " << i; | 315 << "Case " << i; |
316 } else { | 316 } else { |
317 EXPECT_NE(kBehaviorTestCases[i].expected_secondary_allowed, | 317 EXPECT_NE(kBehaviorTestCases[i].expected_secondary_allowed, |
318 MultiProfileUserController::ALLOWED) | 318 MultiProfileUserController::ALLOWED) |
319 << "Case " << i; | 319 << "Case " << i; |
320 } | 320 } |
321 } | 321 } |
322 } | 322 } |
323 | 323 |
324 // Tests that owner could not be a secondary user. | 324 // Tests that owner could not be a secondary user. |
325 TEST_F(MultiProfileUserControllerTest, NoSecondaryOwner) { | 325 // |
| 326 // TODO (ygorshenin@, crbug.com/230018): remove or change the test when the |
| 327 // issue will be fixed. |
| 328 TEST_F(MultiProfileUserControllerTest, DISABLED_NoSecondaryOwner) { |
326 LoginUser(0); | 329 LoginUser(0); |
327 SetOwner(1); | 330 SetOwner(1); |
328 | 331 |
329 MultiProfileUserController::UserAllowedInSessionReason reason; | 332 MultiProfileUserController::UserAllowedInSessionReason reason; |
330 EXPECT_FALSE(controller()->IsUserAllowedInSession(kUsers[1], &reason)); | 333 EXPECT_FALSE(controller()->IsUserAllowedInSession(kUsers[1], &reason)); |
331 EXPECT_EQ(MultiProfileUserController::NOT_ALLOWED_OWNER_AS_SECONDARY, reason); | 334 EXPECT_EQ(MultiProfileUserController::NOT_ALLOWED_OWNER_AS_SECONDARY, reason); |
332 | 335 |
333 EXPECT_EQ(0, user_not_allowed_count()); | 336 EXPECT_EQ(0, user_not_allowed_count()); |
334 LoginUser(1); | 337 LoginUser(1); |
335 EXPECT_EQ(1, user_not_allowed_count()); | 338 EXPECT_EQ(1, user_not_allowed_count()); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 EXPECT_EQ(MultiProfileUserController::NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED, | 437 EXPECT_EQ(MultiProfileUserController::NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED, |
435 reason); | 438 reason); |
436 EXPECT_EQ(MultiProfileUserController::NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED, | 439 EXPECT_EQ(MultiProfileUserController::NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED, |
437 MultiProfileUserController::GetPrimaryUserPolicy()); | 440 MultiProfileUserController::GetPrimaryUserPolicy()); |
438 | 441 |
439 // Flush tasks posted to IO. | 442 // Flush tasks posted to IO. |
440 base::RunLoop().RunUntilIdle(); | 443 base::RunLoop().RunUntilIdle(); |
441 } | 444 } |
442 | 445 |
443 } // namespace chromeos | 446 } // namespace chromeos |
OLD | NEW |