| OLD | NEW |
| 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/system/tray/tray_constants.h" | 7 #include "ash/common/system/tray/tray_constants.h" |
| 8 #include "ash/common/system/user/tray_user_separator.h" | 8 #include "ash/common/system/user/tray_user_separator.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | |
| 11 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 12 #include "ash/shell_delegate.h" | 11 #include "ash/shell_delegate.h" |
| 13 #include "ash/system/tray/system_tray.h" | 12 #include "ash/system/tray/system_tray.h" |
| 14 #include "ash/system/user/tray_user.h" | 13 #include "ash/system/user/tray_user.h" |
| 15 #include "ash/system/user/user_view.h" | 14 #include "ash/system/user/user_view.h" |
| 16 #include "ash/test/ash_test_base.h" | 15 #include "ash/test/ash_test_base.h" |
| 17 #include "ash/test/test_session_state_delegate.h" | 16 #include "ash/test/test_session_state_delegate.h" |
| 18 #include "ash/test/test_shell_delegate.h" | 17 #include "ash/test/test_shell_delegate.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 20 #include "components/signin/core/account_id/account_id.h" | 19 #include "components/signin/core/account_id/account_id.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 67 |
| 69 void TrayUserTest::SetUp() { | 68 void TrayUserTest::SetUp() { |
| 70 ash::test::AshTestBase::SetUp(); | 69 ash::test::AshTestBase::SetUp(); |
| 71 tray_ = Shell::GetPrimaryRootWindowController()->GetSystemTray(); | 70 tray_ = Shell::GetPrimaryRootWindowController()->GetSystemTray(); |
| 72 delegate_ = static_cast<ash::test::TestSessionStateDelegate*>( | 71 delegate_ = static_cast<ash::test::TestSessionStateDelegate*>( |
| 73 ash::Shell::GetInstance()->session_state_delegate()); | 72 ash::Shell::GetInstance()->session_state_delegate()); |
| 74 } | 73 } |
| 75 | 74 |
| 76 void TrayUserTest::InitializeParameters(int users_logged_in, | 75 void TrayUserTest::InitializeParameters(int users_logged_in, |
| 77 bool multiprofile) { | 76 bool multiprofile) { |
| 78 // Show the shelf. | |
| 79 Shelf* shelf = Shelf::ForPrimaryDisplay(); | |
| 80 shelf->shelf_layout_manager()->LayoutShelf(); | |
| 81 shelf->SetAutoHideBehavior(SHELF_AUTO_HIDE_BEHAVIOR_NEVER); | |
| 82 | |
| 83 // Set our default assumptions. Note that it is sufficient to set these | 77 // Set our default assumptions. Note that it is sufficient to set these |
| 84 // after everything was created. | 78 // after everything was created. |
| 85 delegate_->set_logged_in_users(users_logged_in); | 79 delegate_->set_logged_in_users(users_logged_in); |
| 86 ash::test::TestShellDelegate* shell_delegate = | 80 ash::test::TestShellDelegate* shell_delegate = |
| 87 static_cast<ash::test::TestShellDelegate*>( | 81 static_cast<ash::test::TestShellDelegate*>( |
| 88 ash::Shell::GetInstance()->delegate()); | 82 ash::Shell::GetInstance()->delegate()); |
| 89 shell_delegate->set_multi_profiles_enabled(multiprofile); | 83 shell_delegate->set_multi_profiles_enabled(multiprofile); |
| 90 | 84 |
| 91 // 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 |
| 92 // the access easier. | 86 // the access easier. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 // Since the name is capitalized, the email should be different then the | 262 // Since the name is capitalized, the email should be different then the |
| 269 // user_id. | 263 // user_id. |
| 270 EXPECT_NE(active_user->GetAccountId().GetUserEmail(), | 264 EXPECT_NE(active_user->GetAccountId().GetUserEmail(), |
| 271 second_user->GetEmail()); | 265 second_user->GetEmail()); |
| 272 tray()->CloseSystemBubble(); | 266 tray()->CloseSystemBubble(); |
| 273 } | 267 } |
| 274 | 268 |
| 275 #endif | 269 #endif |
| 276 | 270 |
| 277 } // namespace ash | 271 } // namespace ash |
| OLD | NEW |