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

Side by Side Diff: chrome/browser/chromeos/file_manager/file_manager_browsertest.cc

Issue 246253009: Multiprofile: switch to newly added user to the session (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed nits Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/user_manager_impl.h » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // Browser test for basic Chrome OS file manager functionality: 5 // Browser test for basic Chrome OS file manager functionality:
6 // - The file list is updated when a file is added externally to the Downloads 6 // - The file list is updated when a file is added externally to the Downloads
7 // folder. 7 // folder.
8 // - Selecting a file and copy-pasting it with the keyboard copies the file. 8 // - Selecting a file and copy-pasting it with the keyboard copies the file.
9 // - Selecting a file and pressing delete deletes it. 9 // - Selecting a file and pressing delete deletes it.
10 10
(...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 kTestAccounts[DUMMY_ACCOUNT_INDEX].email); 908 kTestAccounts[DUMMY_ACCOUNT_INDEX].email);
909 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, 909 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile,
910 kTestAccounts[DUMMY_ACCOUNT_INDEX].hash); 910 kTestAccounts[DUMMY_ACCOUNT_INDEX].hash);
911 } 911 }
912 912
913 // Logs in to the primary profile of this test. 913 // Logs in to the primary profile of this test.
914 virtual void SetUpOnMainThread() OVERRIDE { 914 virtual void SetUpOnMainThread() OVERRIDE {
915 const TestAccountInfo& info = kTestAccounts[PRIMARY_ACCOUNT_INDEX]; 915 const TestAccountInfo& info = kTestAccounts[PRIMARY_ACCOUNT_INDEX];
916 916
917 AddUser(info, true); 917 AddUser(info, true);
918 chromeos::UserManager* const user_manager = chromeos::UserManager::Get();
919 if (user_manager->GetActiveUser() != user_manager->FindUser(info.email))
920 chromeos::UserManager::Get()->SwitchActiveUser(info.email);
921 FileManagerBrowserTestBase::SetUpOnMainThread(); 918 FileManagerBrowserTestBase::SetUpOnMainThread();
922 } 919 }
923 920
924 // Loads all users to the current session and sets up necessary fields. 921 // Loads all users to the current session and sets up necessary fields.
925 // This is used for preparing all accounts in PRE_ test setup, and for testing 922 // This is used for preparing all accounts in PRE_ test setup, and for testing
926 // actual login behavior. 923 // actual login behavior.
927 void AddAllUsers() { 924 void AddAllUsers() {
928 for (size_t i = 0; i < arraysize(kTestAccounts); ++i) 925 for (size_t i = 0; i < arraysize(kTestAccounts); ++i)
929 AddUser(kTestAccounts[i], i >= SECONDARY_ACCOUNT_INDEX_START); 926 AddUser(kTestAccounts[i], i >= SECONDARY_ACCOUNT_INDEX_START);
930 } 927 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 // (bob and charlie) are added in the test. Thus the existing test verifies 1057 // (bob and charlie) are added in the test. Thus the existing test verifies
1061 // that the feature is effectively working with lastly logged in users. 1058 // that the feature is effectively working with lastly logged in users.
1062 AddExtraUsersForStressTesting(); 1059 AddExtraUsersForStressTesting();
1063 1060
1064 set_test_case_name("multiProfileVisitDesktopMenu"); 1061 set_test_case_name("multiProfileVisitDesktopMenu");
1065 StartTest(); 1062 StartTest();
1066 } 1063 }
1067 1064
1068 } // namespace 1065 } // namespace
1069 } // namespace file_manager 1066 } // namespace file_manager
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/user_manager_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698