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

Unified Diff: ash/common/system/user/tray_user_unittest.cc

Issue 2680993002: Remove non-MD test coverage from TrayUserTest (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/user/tray_user_unittest.cc
diff --git a/ash/common/system/user/tray_user_unittest.cc b/ash/common/system/user/tray_user_unittest.cc
index ce12f3f8e1396a44147d683f6f447f635741ceea..faa749371851c3928fdf0f2e3c97ae9ef1da47de 100644
--- a/ash/common/system/user/tray_user_unittest.cc
+++ b/ash/common/system/user/tray_user_unittest.cc
@@ -4,12 +4,10 @@
#include <vector>
-#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shell_delegate.h"
#include "ash/common/system/tray/system_tray.h"
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/user/tray_user.h"
-#include "ash/common/system/user/tray_user_separator.h"
#include "ash/common/system/user/user_view.h"
#include "ash/common/test/test_session_state_delegate.h"
#include "ash/common/wm_shell.h"
@@ -30,10 +28,6 @@ namespace ash {
namespace {
-bool UseMd() {
- return MaterialDesignController::IsSystemTrayMenuMaterial();
-}
-
class TrayUserTest : public test::AshTestBase {
public:
TrayUserTest() = default;
@@ -57,7 +51,6 @@ class TrayUserTest : public test::AshTestBase {
SystemTray* tray() { return tray_; }
test::TestSessionStateDelegate* delegate() { return delegate_; }
TrayUser* tray_user(int index) { return tray_user_[index]; }
- TrayUserSeparator* tray_user_separator() { return tray_user_separator_; }
private:
SystemTray* tray_ = nullptr;
@@ -66,10 +59,6 @@ class TrayUserTest : public test::AshTestBase {
// Note that the ownership of these items is on the shelf.
std::vector<TrayUser*> tray_user_;
- // The separator between the tray users and the rest of the menu.
- // Note: The item will get owned by the shelf. Not used in Material Design.
- TrayUserSeparator* tray_user_separator_ = nullptr;
-
DISALLOW_COPY_AND_ASSIGN(TrayUserTest);
};
@@ -94,11 +83,6 @@ void TrayUserTest::InitializeParameters(int users_logged_in,
tray_user_.push_back(new TrayUser(tray_, i));
tray_->AddTrayItem(base::WrapUnique(tray_user_[i]));
}
- if (!UseMd()) {
- // We then add also the separator.
- tray_user_separator_ = new TrayUserSeparator(tray_);
- tray_->AddTrayItem(base::WrapUnique(tray_user_separator_));
- }
}
void TrayUserTest::ShowTrayMenu(ui::test::EventGenerator* generator) {
@@ -136,8 +120,7 @@ TEST_F(TrayUserTest, CheckTrayItemSize) {
EXPECT_EQ(kTrayItemSize, size.height());
}
-// Make sure that in single user mode the user panel cannot be activated and no
-// separators are being created.
+// Make sure that in single user mode the user panel cannot be activated.
TEST_F(TrayUserTest, SingleUserModeDoesNotAllowAddingUser) {
InitializeParameters(1, false);
@@ -148,8 +131,6 @@ TEST_F(TrayUserTest, SingleUserModeDoesNotAllowAddingUser) {
for (int i = 0; i < delegate()->GetMaximumNumberOfLoggedInUsers(); i++)
EXPECT_EQ(TrayUser::HIDDEN, tray_user(i)->GetStateForTest());
- if (!UseMd())
- EXPECT_FALSE(tray_user_separator()->separator_shown());
ShowTrayMenu(&generator);
@@ -159,8 +140,6 @@ TEST_F(TrayUserTest, SingleUserModeDoesNotAllowAddingUser) {
for (int i = 0; i < delegate()->GetMaximumNumberOfLoggedInUsers(); i++)
EXPECT_EQ(i == 0 ? TrayUser::SHOWN : TrayUser::HIDDEN,
tray_user(i)->GetStateForTest());
- if (!UseMd())
- EXPECT_FALSE(tray_user_separator()->separator_shown());
tray()->CloseSystemBubble();
}
@@ -195,7 +174,7 @@ TEST_F(TrayUserTest, AccessibleLabelContainsMultiUserInfo) {
}
// Make sure that in multi user mode the user panel can be activated and there
-// will be one panel for each user plus one additional separator at the end.
+// will be one panel for each user.
// Note: the mouse watcher (for automatic closing upon leave) cannot be tested
// here since it does not work with the event system in unit tests.
TEST_F(TrayUserTest, MultiUserModeDoesNotAllowToAddUser) {
@@ -215,11 +194,8 @@ TEST_F(TrayUserTest, MultiUserModeDoesNotAllowToAddUser) {
EXPECT_FALSE(tray()->IsAnyBubbleVisible());
for (int i = 0; i < max_users; i++)
EXPECT_FALSE(tray_user(i)->GetStateForTest());
- if (!UseMd())
- EXPECT_FALSE(tray_user_separator()->separator_shown());
// After clicking on the tray the menu should get shown and for each logged
- // in user we should get a visible item. In addition, the separator should
- // show up when we reach more than one user.
+ // in user we should get a visible item.
ShowTrayMenu(&generator);
EXPECT_TRUE(tray()->HasSystemBubble());
@@ -229,10 +205,6 @@ TEST_F(TrayUserTest, MultiUserModeDoesNotAllowToAddUser) {
tray_user(i)->GetStateForTest());
}
- // Check the visibility of the separator.
- if (!UseMd())
- EXPECT_EQ(j > 1 ? true : false, tray_user_separator()->separator_shown());
-
// Move the mouse over the user item and it should hover.
MoveOverUserItem(&generator, 0);
EXPECT_EQ(TrayUser::HOVERED, tray_user(0)->GetStateForTest());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698