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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 1809963003: Fix shelf overflow bubble position (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 4 years, 9 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 | « ash/shelf/overflow_bubble_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index b79022363e08f2e868cd060451ac4000105a6502..994e1468d8468a81e4c5a7907d76e845c73301fa 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -996,6 +996,31 @@ TEST_F(ShelfViewTest, AssertNoButtonsOverlap) {
}
}
+// Making sure the overflow bubble arrow correctly tracks with shelf position.
+TEST_F(ShelfViewTest, OverflowArrowForShelfPosition) {
+ const ShelfAlignment kAlignments[] = {
+ SHELF_ALIGNMENT_BOTTOM, SHELF_ALIGNMENT_LEFT, SHELF_ALIGNMENT_RIGHT,
+ SHELF_ALIGNMENT_TOP};
+
+ // These must match what is expected for each alignment above.
+ const views::BubbleBorder::Arrow kArrows[] = {
+ views::BubbleBorder::BOTTOM_LEFT, views::BubbleBorder::LEFT_TOP,
+ views::BubbleBorder::RIGHT_TOP, views::BubbleBorder::TOP_LEFT};
+
+ for (int i = 0; i < 4; i++) {
+ shelf_view_->shelf()->SetAlignment(kAlignments[i]);
+
+ // Make sure there are enough icons to trigger the overflow in new
+ // orientation.
+ AddButtonsUntilOverflow();
+ test_api_->ShowOverflowBubble();
+ ASSERT_TRUE(test_api_->overflow_bubble() &&
+ test_api_->overflow_bubble()->IsShowing());
+
+ EXPECT_EQ(test_api_->overflow_bubble()->bubble_view()->arrow(), kArrows[i]);
+ }
+}
+
// Adds button until overflow then removes first added one. Verifies that
// the last added one changes from invisible to visible and overflow
// chevron is gone.
@@ -1658,8 +1683,7 @@ TEST_F(ShelfViewTest, CheckDragInsertBoundsOfScrolledOverflowBubble) {
ASSERT_TRUE(test_api_->overflow_bubble() &&
test_api_->overflow_bubble()->IsShowing());
- int item_width = test_api_->GetButtonSize() +
- test_api_->GetButtonSpacing();
+ int item_width = test_api_->GetButtonSize() + test_api_->GetButtonSpacing();
OverflowBubbleView* bubble_view = test_api_->overflow_bubble()->bubble_view();
test::OverflowBubbleViewTestAPI bubble_view_api(bubble_view);
« no previous file with comments | « ash/shelf/overflow_bubble_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698