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

Side by Side Diff: ash/system/user/tray_user_unittest.cc

Issue 2118593002: mash: Migrate ShellDelegate ownership and access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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/shell_unittest.cc ('k') | ash/system/user/user_view.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <vector> 5 #include <vector>
6 6
7 #include "ash/common/shell_delegate.h"
7 #include "ash/common/system/tray/tray_constants.h" 8 #include "ash/common/system/tray/tray_constants.h"
8 #include "ash/common/system/user/tray_user_separator.h" 9 #include "ash/common/system/user/tray_user_separator.h"
10 #include "ash/common/wm_shell.h"
9 #include "ash/root_window_controller.h" 11 #include "ash/root_window_controller.h"
10 #include "ash/shell.h" 12 #include "ash/shell.h"
11 #include "ash/shell_delegate.h"
12 #include "ash/system/tray/system_tray.h" 13 #include "ash/system/tray/system_tray.h"
13 #include "ash/system/user/tray_user.h" 14 #include "ash/system/user/tray_user.h"
14 #include "ash/system/user/user_view.h" 15 #include "ash/system/user/user_view.h"
15 #include "ash/test/ash_test_base.h" 16 #include "ash/test/ash_test_base.h"
16 #include "ash/test/ash_test_helper.h" 17 #include "ash/test/ash_test_helper.h"
17 #include "ash/test/test_session_state_delegate.h" 18 #include "ash/test/test_session_state_delegate.h"
18 #include "ash/test/test_shell_delegate.h" 19 #include "ash/test/test_shell_delegate.h"
19 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
20 #include "components/signin/core/account_id/account_id.h" 21 #include "components/signin/core/account_id/account_id.h"
21 #include "components/user_manager/user_info.h" 22 #include "components/user_manager/user_info.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 tray_ = Shell::GetPrimaryRootWindowController()->GetSystemTray(); 72 tray_ = Shell::GetPrimaryRootWindowController()->GetSystemTray();
72 delegate_ = test::AshTestHelper::GetTestSessionStateDelegate(); 73 delegate_ = test::AshTestHelper::GetTestSessionStateDelegate();
73 } 74 }
74 75
75 void TrayUserTest::InitializeParameters(int users_logged_in, 76 void TrayUserTest::InitializeParameters(int users_logged_in,
76 bool multiprofile) { 77 bool multiprofile) {
77 // Set our default assumptions. Note that it is sufficient to set these 78 // Set our default assumptions. Note that it is sufficient to set these
78 // after everything was created. 79 // after everything was created.
79 delegate_->set_logged_in_users(users_logged_in); 80 delegate_->set_logged_in_users(users_logged_in);
80 test::TestShellDelegate* shell_delegate = 81 test::TestShellDelegate* shell_delegate =
81 static_cast<test::TestShellDelegate*>(Shell::GetInstance()->delegate()); 82 static_cast<test::TestShellDelegate*>(WmShell::Get()->delegate());
82 shell_delegate->set_multi_profiles_enabled(multiprofile); 83 shell_delegate->set_multi_profiles_enabled(multiprofile);
83 84
84 // Instead of using the existing tray panels we create new ones which makes 85 // Instead of using the existing tray panels we create new ones which makes
85 // the access easier. 86 // the access easier.
86 for (int i = 0; i < delegate_->GetMaximumNumberOfLoggedInUsers(); i++) { 87 for (int i = 0; i < delegate_->GetMaximumNumberOfLoggedInUsers(); i++) {
87 tray_user_.push_back(new TrayUser(tray_, i)); 88 tray_user_.push_back(new TrayUser(tray_, i));
88 tray_->AddTrayItem(tray_user_[i]); 89 tray_->AddTrayItem(tray_user_[i]);
89 } 90 }
90 // We then add also the separator. 91 // We then add also the separator.
91 tray_user_separator_ = new TrayUserSeparator(tray_); 92 tray_user_separator_ = new TrayUserSeparator(tray_);
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // Since the name is capitalized, the email should be different then the 261 // Since the name is capitalized, the email should be different then the
261 // user_id. 262 // user_id.
262 EXPECT_NE(active_user->GetAccountId().GetUserEmail(), 263 EXPECT_NE(active_user->GetAccountId().GetUserEmail(),
263 second_user->GetEmail()); 264 second_user->GetEmail());
264 tray()->CloseSystemBubble(); 265 tray()->CloseSystemBubble();
265 } 266 }
266 267
267 #endif 268 #endif
268 269
269 } // namespace ash 270 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell_unittest.cc ('k') | ash/system/user/user_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698