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

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

Issue 2741273002: chromeos: Promotes more from WmShell to Shell (Closed)
Patch Set: feedback Created 3 years, 9 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/common/shutdown_controller.cc ('k') | ash/common/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/shell_delegate.h"
8 #include "ash/common/system/tray/system_tray.h" 8 #include "ash/common/system/tray/system_tray.h"
9 #include "ash/common/system/tray/tray_constants.h" 9 #include "ash/common/system/tray/tray_constants.h"
10 #include "ash/common/system/user/tray_user.h" 10 #include "ash/common/system/user/tray_user.h"
11 #include "ash/common/system/user/user_view.h" 11 #include "ash/common/system/user/user_view.h"
12 #include "ash/common/test/test_session_state_delegate.h" 12 #include "ash/common/test/test_session_state_delegate.h"
13 #include "ash/common/wm_shell.h" 13 #include "ash/shell.h"
14 #include "ash/test/ash_test_base.h" 14 #include "ash/test/ash_test_base.h"
15 #include "ash/test/ash_test_helper.h" 15 #include "ash/test/ash_test_helper.h"
16 #include "ash/test/test_shell_delegate.h" 16 #include "ash/test/test_shell_delegate.h"
17 #include "base/memory/ptr_util.h" 17 #include "base/memory/ptr_util.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #include "components/signin/core/account_id/account_id.h" 19 #include "components/signin/core/account_id/account_id.h"
20 #include "components/user_manager/user_info.h" 20 #include "components/user_manager/user_info.h"
21 #include "ui/accessibility/ax_node_data.h" 21 #include "ui/accessibility/ax_node_data.h"
22 #include "ui/events/test/event_generator.h" 22 #include "ui/events/test/event_generator.h"
23 #include "ui/gfx/animation/animation_container_element.h" 23 #include "ui/gfx/animation/animation_container_element.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 tray_ = GetPrimarySystemTray(); 67 tray_ = GetPrimarySystemTray();
68 delegate_ = test::AshTestHelper::GetTestSessionStateDelegate(); 68 delegate_ = test::AshTestHelper::GetTestSessionStateDelegate();
69 } 69 }
70 70
71 void TrayUserTest::InitializeParameters(int users_logged_in, 71 void TrayUserTest::InitializeParameters(int users_logged_in,
72 bool multiprofile) { 72 bool multiprofile) {
73 // Set our default assumptions. Note that it is sufficient to set these 73 // Set our default assumptions. Note that it is sufficient to set these
74 // after everything was created. 74 // after everything was created.
75 delegate_->set_logged_in_users(users_logged_in); 75 delegate_->set_logged_in_users(users_logged_in);
76 test::TestShellDelegate* shell_delegate = 76 test::TestShellDelegate* shell_delegate =
77 static_cast<test::TestShellDelegate*>(WmShell::Get()->delegate()); 77 static_cast<test::TestShellDelegate*>(Shell::Get()->shell_delegate());
78 shell_delegate->set_multi_profiles_enabled(multiprofile); 78 shell_delegate->set_multi_profiles_enabled(multiprofile);
79 79
80 // Instead of using the existing tray panels we create new ones which makes 80 // Instead of using the existing tray panels we create new ones which makes
81 // the access easier. 81 // the access easier.
82 for (int i = 0; i < delegate_->GetMaximumNumberOfLoggedInUsers(); i++) { 82 for (int i = 0; i < delegate_->GetMaximumNumberOfLoggedInUsers(); i++) {
83 tray_user_.push_back(new TrayUser(tray_, i)); 83 tray_user_.push_back(new TrayUser(tray_, i));
84 tray_->AddTrayItem(base::WrapUnique(tray_user_[i])); 84 tray_->AddTrayItem(base::WrapUnique(tray_user_[i]));
85 } 85 }
86 } 86 }
87 87
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 const user_manager::UserInfo* second_user = delegate()->GetUserInfo(1); 245 const user_manager::UserInfo* second_user = delegate()->GetUserInfo(1);
246 EXPECT_EQ(active_user->GetAccountId(), second_user->GetAccountId()); 246 EXPECT_EQ(active_user->GetAccountId(), second_user->GetAccountId());
247 // Since the name is capitalized, the email should be different than the 247 // Since the name is capitalized, the email should be different than the
248 // user_id. 248 // user_id.
249 EXPECT_NE(active_user->GetAccountId().GetUserEmail(), 249 EXPECT_NE(active_user->GetAccountId().GetUserEmail(),
250 second_user->GetDisplayEmail()); 250 second_user->GetDisplayEmail());
251 tray()->CloseSystemBubble(); 251 tray()->CloseSystemBubble();
252 } 252 }
253 253
254 } // namespace ash 254 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shutdown_controller.cc ('k') | ash/common/system/user/user_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698