| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ash/session/session_controller.h" | 5 #include "ash/session/session_controller.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 | 341 |
| 342 // Mark a running unlock animation. | 342 // Mark a running unlock animation. |
| 343 controller()->RunUnlockAnimation(base::Closure()); | 343 controller()->RunUnlockAnimation(base::Closure()); |
| 344 | 344 |
| 345 EXPECT_EQ(test_case.expected_is_user_session_blocked, | 345 EXPECT_EQ(test_case.expected_is_user_session_blocked, |
| 346 controller()->IsUserSessionBlocked()) | 346 controller()->IsUserSessionBlocked()) |
| 347 << "Test case state=" << static_cast<int>(test_case.state); | 347 << "Test case state=" << static_cast<int>(test_case.state); |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 | 350 |
| 351 TEST_F(SessionControllerTest, IsUserSupervised) { |
| 352 mojom::UserSessionPtr session = mojom::UserSession::New(); |
| 353 session->session_id = 1u; |
| 354 session->type = user_manager::USER_TYPE_SUPERVISED; |
| 355 controller()->UpdateUserSession(std::move(session)); |
| 356 |
| 357 EXPECT_TRUE(controller()->IsUserSupervised()); |
| 358 } |
| 359 |
| 360 TEST_F(SessionControllerTest, IsUserChild) { |
| 361 mojom::UserSessionPtr session = mojom::UserSession::New(); |
| 362 session->session_id = 1u; |
| 363 session->type = user_manager::USER_TYPE_CHILD; |
| 364 controller()->UpdateUserSession(std::move(session)); |
| 365 |
| 366 EXPECT_TRUE(controller()->IsUserChild()); |
| 367 |
| 368 // Child accounts are supervised. |
| 369 EXPECT_TRUE(controller()->IsUserSupervised()); |
| 370 } |
| 371 |
| 351 } // namespace | 372 } // namespace |
| 352 } // namespace ash | 373 } // namespace ash |
| OLD | NEW |