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

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

Issue 2619653002: ash: SessionControllerClient observes user image change (Closed)
Patch Set: rebase Created 3 years, 11 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 | « no previous file | chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.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 (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 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/chromeos/drive/file_system_util.h" 9 #include "chrome/browser/chromeos/drive/file_system_util.h"
10 #include "chrome/browser/chromeos/file_manager/file_manager_browsertest_base.h" 10 #include "chrome/browser/chromeos/file_manager/file_manager_browsertest_base.h"
11 #include "chrome/browser/chromeos/profiles/profile_helper.h" 11 #include "chrome/browser/chromeos/profiles/profile_helper.h"
12 #include "chrome/browser/signin/signin_manager_factory.h" 12 #include "chrome/browser/signin/signin_manager_factory.h"
13 #include "chromeos/chromeos_switches.h" 13 #include "chromeos/chromeos_switches.h"
14 #include "components/session_manager/core/session_manager.h"
14 #include "components/signin/core/browser/signin_manager.h" 15 #include "components/signin/core/browser/signin_manager.h"
15 #include "components/user_manager/user_manager.h" 16 #include "components/user_manager/user_manager.h"
16 17
17 namespace file_manager { 18 namespace file_manager {
18 19
19 // Parameter of FileManagerBrowserTest. 20 // Parameter of FileManagerBrowserTest.
20 // The second value is the case name of JavaScript. 21 // The second value is the case name of JavaScript.
21 typedef std::tr1::tuple<GuestMode, const char*> TestParameter; 22 typedef std::tr1::tuple<GuestMode, const char*> TestParameter;
22 23
23 // Test fixture class for normal (not multi-profile related) tests. 24 // Test fixture class for normal (not multi-profile related) tests.
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 Profile* const profile = chromeos::ProfileHelper::GetProfileByUserIdHash( 629 Profile* const profile = chromeos::ProfileHelper::GetProfileByUserIdHash(
629 kTestAccounts[PRIMARY_ACCOUNT_INDEX].hash); 630 kTestAccounts[PRIMARY_ACCOUNT_INDEX].hash);
630 return profile ? profile : FileManagerBrowserTestBase::profile(); 631 return profile ? profile : FileManagerBrowserTestBase::profile();
631 } 632 }
632 633
633 // Sets the test case name (used as a function name in test_cases.js to call.) 634 // Sets the test case name (used as a function name in test_cases.js to call.)
634 void set_test_case_name(const std::string& name) { test_case_name_ = name; } 635 void set_test_case_name(const std::string& name) { test_case_name_ = name; }
635 636
636 // Adds a new user for testing to the current session. 637 // Adds a new user for testing to the current session.
637 void AddUser(const TestAccountInfo& info, bool log_in) { 638 void AddUser(const TestAccountInfo& info, bool log_in) {
638 user_manager::UserManager* const user_manager =
639 user_manager::UserManager::Get();
640 const AccountId account_id(AccountId::FromUserEmail(info.email)); 639 const AccountId account_id(AccountId::FromUserEmail(info.email));
641 if (log_in) 640 if (log_in) {
642 user_manager->UserLoggedIn(account_id, info.hash, false); 641 session_manager::SessionManager::Get()->CreateSession(account_id,
643 user_manager->SaveUserDisplayName(account_id, 642 info.hash);
644 base::UTF8ToUTF16(info.display_name)); 643 }
644 user_manager::UserManager::Get()->SaveUserDisplayName(
645 account_id, base::UTF8ToUTF16(info.display_name));
645 SigninManagerFactory::GetForProfile( 646 SigninManagerFactory::GetForProfile(
646 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)) 647 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash))
647 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email); 648 ->SetAuthenticatedAccountInfo(info.gaia_id, info.email);
648 } 649 }
649 650
650 private: 651 private:
651 GuestMode GetGuestModeParam() const override { return NOT_IN_GUEST_MODE; } 652 GuestMode GetGuestModeParam() const override { return NOT_IN_GUEST_MODE; }
652 const char* GetTestManifestName() const override { 653 const char* GetTestManifestName() const override {
653 return "file_manager_test_manifest.json"; 654 return "file_manager_test_manifest.json";
654 } 655 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 697
697 IN_PROC_BROWSER_TEST_F(MultiProfileFileManagerBrowserTest, MAYBE_BasicDrive) { 698 IN_PROC_BROWSER_TEST_F(MultiProfileFileManagerBrowserTest, MAYBE_BasicDrive) {
698 AddAllUsers(); 699 AddAllUsers();
699 700
700 // Sanity check that normal operations work in multi-profile setting as well. 701 // Sanity check that normal operations work in multi-profile setting as well.
701 set_test_case_name("keyboardCopyDrive"); 702 set_test_case_name("keyboardCopyDrive");
702 StartTest(); 703 StartTest();
703 } 704 }
704 705
705 } // namespace file_manager 706 } // namespace file_manager
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698