Commit 1daf04c3 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Remove SetRepositionTargetForTest.

MessageListView::SetRepositionTargetForTest just calls
SetRepositionTarget internally. We can simply replace all references to
SetRepositionTargetForTest by SetRepositionTarget.

TEST=ash_unittests
BUG=none

Change-Id: I3294e2cce6d995585baed3a0ce29dd068e656b20
Reviewed-on: https://chromium-review.googlesource.com/882629
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532349}
parent a4e071f7
......@@ -479,7 +479,7 @@ TEST_F(MessageCenterViewTest, SizeAfterUpdateBelowWithRepositionTarget) {
EXPECT_LT(GetNotificationView(kNotificationId2)->bounds().y(),
GetNotificationView(kNotificationId1)->bounds().y());
GetMessageListView()->SetRepositionTargetForTest(
GetMessageListView()->SetRepositionTarget(
GetNotificationView(kNotificationId1)->bounds());
std::unique_ptr<Notification> notification = std::make_unique<Notification>(
......@@ -509,7 +509,7 @@ TEST_F(MessageCenterViewTest, SizeAfterUpdateOfRepositionTarget) {
EXPECT_LT(GetNotificationView(kNotificationId2)->bounds().y(),
GetNotificationView(kNotificationId1)->bounds().y());
GetMessageListView()->SetRepositionTargetForTest(
GetMessageListView()->SetRepositionTarget(
GetNotificationView(kNotificationId1)->bounds());
std::unique_ptr<Notification> notification = std::make_unique<Notification>(
......@@ -555,7 +555,7 @@ TEST_F(MessageCenterViewTest, PositionAfterUpdate) {
int previous_vertical_pos_from_bottom =
GetMessageListView()->height() -
GetNotificationView(kNotificationId1)->bounds().y();
GetMessageListView()->SetRepositionTargetForTest(
GetMessageListView()->SetRepositionTarget(
GetNotificationView(kNotificationId1)->bounds());
std::unique_ptr<Notification> notification = std::make_unique<Notification>(
......@@ -582,7 +582,7 @@ TEST_F(MessageCenterViewTest, PositionAfterRemove) {
EXPECT_LT(GetNotificationView(kNotificationId2)->bounds().y(),
GetNotificationView(kNotificationId1)->bounds().y());
GetMessageListView()->SetRepositionTargetForTest(
GetMessageListView()->SetRepositionTarget(
GetNotificationView(kNotificationId2)->bounds());
int previous_height = GetMessageListView()->height();
int previous_notification2_y =
......
......@@ -586,8 +586,4 @@ void MessageListView::AnimateClearingOneNotification() {
}
}
void MessageListView::SetRepositionTargetForTest(const gfx::Rect& target_rect) {
SetRepositionTarget(target_rect);
}
} // namespace ash
......@@ -54,15 +54,20 @@ class ASH_EXPORT MessageListView : public views::View,
// Return the number of the valid notification. This traverse the items so it
// costs O(n) time, where n is the number of total notifications.
size_t GetNotificationCount() const;
// SetRepositionTarget sets the target that the physical location of
// the notification at |target_rect| does not change after the repositining.
// Repositioning is a process to change the positions of the notifications,
// which is caused by addition/modification/removal of notifications.
// The term is almost interchangeable with animation.
void SetRepositionTarget(const gfx::Rect& target_rect);
void ResetRepositionSession();
void ClearAllClosableNotifications(const gfx::Rect& visible_scroll_rect);
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
void SetRepositionTargetForTest(const gfx::Rect& target_rect);
void set_scroller(views::ScrollView* scroller) { scroller_ = scroller; }
protected:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment