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

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

Issue 763673002: Replace direct access to kGoogleServicesUsername with calls to SigninManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years 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 (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 18 matching lines...) Expand all
29 #include "chrome/browser/chromeos/file_manager/drive_test_util.h" 29 #include "chrome/browser/chromeos/file_manager/drive_test_util.h"
30 #include "chrome/browser/chromeos/file_manager/path_util.h" 30 #include "chrome/browser/chromeos/file_manager/path_util.h"
31 #include "chrome/browser/chromeos/file_manager/volume_manager.h" 31 #include "chrome/browser/chromeos/file_manager/volume_manager.h"
32 #include "chrome/browser/chromeos/profiles/profile_helper.h" 32 #include "chrome/browser/chromeos/profiles/profile_helper.h"
33 #include "chrome/browser/drive/fake_drive_service.h" 33 #include "chrome/browser/drive/fake_drive_service.h"
34 #include "chrome/browser/extensions/component_loader.h" 34 #include "chrome/browser/extensions/component_loader.h"
35 #include "chrome/browser/extensions/extension_apitest.h" 35 #include "chrome/browser/extensions/extension_apitest.h"
36 #include "chrome/browser/notifications/notification.h" 36 #include "chrome/browser/notifications/notification.h"
37 #include "chrome/browser/notifications/notification_ui_manager.h" 37 #include "chrome/browser/notifications/notification_ui_manager.h"
38 #include "chrome/browser/profiles/profile.h" 38 #include "chrome/browser/profiles/profile.h"
39 #include "chrome/browser/signin/signin_manager_factory.h"
39 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 40 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
40 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" 41 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
41 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
42 #include "chrome/common/pref_names.h" 43 #include "chrome/common/pref_names.h"
43 #include "chromeos/chromeos_switches.h" 44 #include "chromeos/chromeos_switches.h"
45 #include "components/signin/core/browser/signin_manager.h"
44 #include "components/user_manager/user_manager.h" 46 #include "components/user_manager/user_manager.h"
45 #include "content/public/browser/notification_service.h" 47 #include "content/public/browser/notification_service.h"
46 #include "content/public/test/test_utils.h" 48 #include "content/public/test/test_utils.h"
47 #include "extensions/browser/api/test/test_api.h" 49 #include "extensions/browser/api/test/test_api.h"
48 #include "extensions/browser/app_window/app_window.h" 50 #include "extensions/browser/app_window/app_window.h"
49 #include "extensions/browser/app_window/app_window_registry.h" 51 #include "extensions/browser/app_window/app_window_registry.h"
50 #include "extensions/browser/notification_types.h" 52 #include "extensions/browser/notification_types.h"
51 #include "extensions/common/extension.h" 53 #include "extensions/common/extension.h"
52 #include "extensions/test/extension_test_message_listener.h" 54 #include "extensions/test/extension_test_message_listener.h"
53 #include "google_apis/drive/drive_api_parser.h" 55 #include "google_apis/drive/drive_api_parser.h"
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after
1197 void set_test_case_name(const std::string& name) { test_case_name_ = name; } 1199 void set_test_case_name(const std::string& name) { test_case_name_ = name; }
1198 1200
1199 // Adds a new user for testing to the current session. 1201 // Adds a new user for testing to the current session.
1200 void AddUser(const TestAccountInfo& info, bool log_in) { 1202 void AddUser(const TestAccountInfo& info, bool log_in) {
1201 user_manager::UserManager* const user_manager = 1203 user_manager::UserManager* const user_manager =
1202 user_manager::UserManager::Get(); 1204 user_manager::UserManager::Get();
1203 if (log_in) 1205 if (log_in)
1204 user_manager->UserLoggedIn(info.email, info.hash, false); 1206 user_manager->UserLoggedIn(info.email, info.hash, false);
1205 user_manager->SaveUserDisplayName(info.email, 1207 user_manager->SaveUserDisplayName(info.email,
1206 base::UTF8ToUTF16(info.display_name)); 1208 base::UTF8ToUTF16(info.display_name));
1207 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)->GetPrefs()-> 1209 SigninManagerFactory::GetForProfile(
1208 SetString(prefs::kGoogleServicesUsername, info.email); 1210 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash))->
xiyuan 2014/12/04 19:02:29 nit: fix indent
Roger Tawa OOO till Jul 10th 2014/12/04 22:26:47 Done.
1211 SetAuthenticatedUsername(info.email);
1209 } 1212 }
1210 1213
1211 private: 1214 private:
1212 virtual GuestMode GetGuestModeParam() const override { 1215 virtual GuestMode GetGuestModeParam() const override {
1213 return NOT_IN_GUEST_MODE; 1216 return NOT_IN_GUEST_MODE;
1214 } 1217 }
1215 1218
1216 virtual const char* GetTestCaseNameParam() const override { 1219 virtual const char* GetTestCaseNameParam() const override {
1217 return test_case_name_.c_str(); 1220 return test_case_name_.c_str();
1218 } 1221 }
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1541 } 1544 }
1542 1545
1543 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { 1546 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) {
1544 AddScript("video_player/open_video_files.js"); 1547 AddScript("video_player/open_video_files.js");
1545 set_test_case_name("openSingleVideoOnDrive"); 1548 set_test_case_name("openSingleVideoOnDrive");
1546 StartTest(); 1549 StartTest();
1547 } 1550 }
1548 1551
1549 } // namespace 1552 } // namespace
1550 } // namespace file_manager 1553 } // namespace file_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698