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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 302653008: Moving default minimize location to the app launcher item. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding the functionality to return the overflow button as target if needed Created 6 years, 7 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
Index: ash/shelf/shelf_view_unittest.cc
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 91e54fede75beca29bd5777d8bc02050f8241489..d57e23eccb31a875d2cb862fb6342d424f6c5d1e 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -638,6 +638,33 @@ TEST_P(ShelfViewTextDirectionTest, IdealBoundsOfItemIcon) {
EXPECT_EQ(item_bounds.y(), ideal_bounds.y());
}
+// Check that items in the overflow area are returning the overflow button as
+// ideal bounds.
+TEST_F(ShelfViewTest, OverflowButtonBounds) {
+ ShelfID first_id = AddPlatformApp();
+ ShelfID overflow_id = AddPlatformApp();
+ int items_added = 0;
+ while (!test_api_->IsOverflowButtonVisible()) {
+ // Added button is visible after animation while in this loop.
+ EXPECT_TRUE(GetButtonByID(overflow_id)->visible());
+ overflow_id = AddPlatformApp();
+ ++items_added;
+ ASSERT_LT(items_added, 10000);
+ }
+ ShelfID last_id = AddPlatformApp();
+
+ gfx::Rect first_bounds = shelf_view_->GetIdealBoundsOfItemIcon(first_id);
+ gfx::Rect overflow_bounds =
+ shelf_view_->GetIdealBoundsOfItemIcon(overflow_id);
+ gfx::Rect last_bounds = shelf_view_->GetIdealBoundsOfItemIcon(last_id);
+
+ // Check that all items have the same size and that the overflow items are
+ // identical whereas the first one does not match either of them.
+ EXPECT_EQ(first_bounds.size().ToString(), last_bounds.size().ToString());
+ EXPECT_NE(first_bounds.ToString(), last_bounds.ToString());
+ EXPECT_EQ(overflow_bounds.ToString(), last_bounds.ToString());
+}
+
// Checks that shelf view contents are considered in the correct drag group.
TEST_F(ShelfViewTest, EnforceDragType) {
EXPECT_TRUE(test_api_->SameDragType(TYPE_PLATFORM_APP, TYPE_PLATFORM_APP));

Powered by Google App Engine
This is Rietveld 408576698