Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Side by Side Diff: ash/session/session_controller_unittest.cc

Issue 2829813002: cros: Move IsUserSupervised and IsUserChild off SystemTrayDelegate (Closed)
Patch Set: review comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/session/session_controller.cc ('k') | ash/shelf/wm_shelf.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/session/session_controller.cc ('k') | ash/shelf/wm_shelf.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698