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

Side by Side Diff: chrome/browser/chromeos/login/supervised/supervised_user_test_base.cc

Issue 745613002: [cros] Cleanup: remove LoginUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get rid of FakeChromeUserManager usage in ExistingUserController* tests Created 5 years, 10 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
OLDNEW
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/supervised/supervised_user_test_base.h" 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_test_base.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1); 361 EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1);
362 362
363 // Log in as supervised user, make sure that everything works. 363 // Log in as supervised user, make sure that everything works.
364 ASSERT_EQ(3UL, user_manager::UserManager::Get()->GetUsers().size()); 364 ASSERT_EQ(3UL, user_manager::UserManager::Get()->GetUsers().size());
365 365
366 // Created supervised user have to be first in a list. 366 // Created supervised user have to be first in a list.
367 const user_manager::User* user = 367 const user_manager::User* user =
368 user_manager::UserManager::Get()->GetUsers().at(user_index); 368 user_manager::UserManager::Get()->GetUsers().at(user_index);
369 ASSERT_EQ(base::UTF8ToUTF16(expected_display_name), user->display_name()); 369 ASSERT_EQ(base::UTF8ToUTF16(expected_display_name), user->display_name());
370 370
371 // Currently FakeLoginUtils do not support first-run use cases.
372 // Clean first run flag before logging in. 371 // Clean first run flag before logging in.
373 static_cast<SupervisedUserManagerImpl*>( 372 static_cast<SupervisedUserManagerImpl*>(
374 ChromeUserManager::Get()->GetSupervisedUserManager()) 373 ChromeUserManager::Get()->GetSupervisedUserManager())
375 ->CheckForFirstRun(user->email()); 374 ->CheckForFirstRun(user->email());
376 375
377 LoginUser(user->email()); 376 LoginUser(user->email());
378 if (check_homedir_calls) 377 if (check_homedir_calls)
379 ::testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_); 378 ::testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_);
380 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user); 379 Profile* profile = ProfileHelper::Get()->GetProfileByUserUnsafe(user);
381 shared_settings_adapter_.reset( 380 shared_settings_adapter_.reset(
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 JSEval(StringPrintf( 438 JSEval(StringPrintf(
440 "$('pod-row').pods[%d].querySelector('.remove-warning-button').click()", 439 "$('pod-row').pods[%d].querySelector('.remove-warning-button').click()",
441 user_index)); 440 user_index));
442 441
443 // Make sure there is no supervised user in list. 442 // Make sure there is no supervised user in list.
444 ASSERT_EQ(original_user_count - 1, 443 ASSERT_EQ(original_user_count - 1,
445 user_manager::UserManager::Get()->GetUsers().size()); 444 user_manager::UserManager::Get()->GetUsers().size());
446 } 445 }
447 446
448 } // namespace chromeos 447 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698