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/session/session_controller.h" | 7 #include "ash/common/session/session_controller.h" |
8 #include "ash/common/shell_delegate.h" | 8 #include "ash/common/shell_delegate.h" |
9 #include "ash/common/system/tray/system_tray.h" | 9 #include "ash/common/system/tray/system_tray.h" |
10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 void ShowTrayMenu(ui::test::EventGenerator* generator); | 48 void ShowTrayMenu(ui::test::EventGenerator* generator); |
49 | 49 |
50 // Move the mouse over the user item. | 50 // Move the mouse over the user item. |
51 void MoveOverUserItem(ui::test::EventGenerator* generator, int index); | 51 void MoveOverUserItem(ui::test::EventGenerator* generator, int index); |
52 | 52 |
53 // Click on the user item. Note that the tray menu needs to be shown. | 53 // Click on the user item. Note that the tray menu needs to be shown. |
54 void ClickUserItem(ui::test::EventGenerator* generator, int index); | 54 void ClickUserItem(ui::test::EventGenerator* generator, int index); |
55 | 55 |
56 // Accessors to various system components. | 56 // Accessors to various system components. |
57 SystemTray* tray() { return tray_; } | 57 SystemTray* tray() { return tray_; } |
58 SessionController* controller() { | 58 SessionController* controller() { return Shell::Get()->session_controller(); } |
59 return WmShell::Get()->session_controller(); | |
60 } | |
61 TrayUser* tray_user(int index) { return tray_user_[index]; } | 59 TrayUser* tray_user(int index) { return tray_user_[index]; } |
62 | 60 |
63 private: | 61 private: |
64 SystemTray* tray_ = nullptr; | 62 SystemTray* tray_ = nullptr; |
65 | 63 |
66 // Note that the ownership of these items is on the shelf. | 64 // Note that the ownership of these items is on the shelf. |
67 std::vector<TrayUser*> tray_user_; | 65 std::vector<TrayUser*> tray_user_; |
68 | 66 |
69 DISALLOW_COPY_AND_ASSIGN(TrayUserTest); | 67 DISALLOW_COPY_AND_ASSIGN(TrayUserTest); |
70 }; | 68 }; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 | 261 |
264 const mojom::UserSession* active_user = controller()->GetUserSession(0); | 262 const mojom::UserSession* active_user = controller()->GetUserSession(0); |
265 EXPECT_EQ(active_user->account_id, second_user->account_id); | 263 EXPECT_EQ(active_user->account_id, second_user->account_id); |
266 // Since the name is capitalized, the email should be different than the | 264 // Since the name is capitalized, the email should be different than the |
267 // user_id. | 265 // user_id. |
268 EXPECT_NE(active_user->account_id.GetUserEmail(), second_user->display_email); | 266 EXPECT_NE(active_user->account_id.GetUserEmail(), second_user->display_email); |
269 tray()->CloseSystemBubble(); | 267 tray()->CloseSystemBubble(); |
270 } | 268 } |
271 | 269 |
272 } // namespace ash | 270 } // namespace ash |
OLD | NEW |