| 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/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" |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // Set the number of logged in users. | 198 // Set the number of logged in users. |
| 199 delegate()->set_logged_in_users(j); | 199 delegate()->set_logged_in_users(j); |
| 200 | 200 |
| 201 // Verify that nothing is shown. | 201 // Verify that nothing is shown. |
| 202 EXPECT_FALSE(tray()->IsAnyBubbleVisible()); | 202 EXPECT_FALSE(tray()->IsAnyBubbleVisible()); |
| 203 for (int i = 0; i < max_users; i++) | 203 for (int i = 0; i < max_users; i++) |
| 204 EXPECT_FALSE(tray_user(i)->GetStateForTest()); | 204 EXPECT_FALSE(tray_user(i)->GetStateForTest()); |
| 205 EXPECT_FALSE(tray_user_separator()->separator_shown()); | 205 EXPECT_FALSE(tray_user_separator()->separator_shown()); |
| 206 // After clicking on the tray the menu should get shown and for each logged | 206 // After clicking on the tray the menu should get shown and for each logged |
| 207 // in user we should get a visible item. In addition, the separator should | 207 // in user we should get a visible item. In addition, the separator should |
| 208 // show up when we reach more then one user. | 208 // show up when we reach more than one user. |
| 209 ShowTrayMenu(&generator); | 209 ShowTrayMenu(&generator); |
| 210 | 210 |
| 211 EXPECT_TRUE(tray()->HasSystemBubble()); | 211 EXPECT_TRUE(tray()->HasSystemBubble()); |
| 212 EXPECT_TRUE(tray()->IsAnyBubbleVisible()); | 212 EXPECT_TRUE(tray()->IsAnyBubbleVisible()); |
| 213 for (int i = 0; i < max_users; i++) { | 213 for (int i = 0; i < max_users; i++) { |
| 214 EXPECT_EQ(i < j ? TrayUser::SHOWN : TrayUser::HIDDEN, | 214 EXPECT_EQ(i < j ? TrayUser::SHOWN : TrayUser::HIDDEN, |
| 215 tray_user(i)->GetStateForTest()); | 215 tray_user(i)->GetStateForTest()); |
| 216 } | 216 } |
| 217 | 217 |
| 218 // Check the visibility of the separator. | 218 // Check the visibility of the separator. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // Since the name is capitalized, the email should be different then the | 259 // Since the name is capitalized, the email should be different then the |
| 260 // user_id. | 260 // user_id. |
| 261 EXPECT_NE(active_user->GetAccountId().GetUserEmail(), | 261 EXPECT_NE(active_user->GetAccountId().GetUserEmail(), |
| 262 second_user->GetEmail()); | 262 second_user->GetEmail()); |
| 263 tray()->CloseSystemBubble(); | 263 tray()->CloseSystemBubble(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 #endif | 266 #endif |
| 267 | 267 |
| 268 } // namespace ash | 268 } // namespace ash |
| OLD | NEW |