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

Unified Diff: ash/shelf/shelf_view_unittest.cc

Issue 1948543005: App icon from subfolder appears in the wrong place when pinning to shelf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add unittest Created 4 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
« no previous file with comments | « ash/shelf/shelf_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 e8572f2a5473868876ce0fefd3af851de4ad23c6..a2a083e4d12aa783f46446af33bf6bbbc3b942c9 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -393,6 +393,19 @@ class ShelfViewTest : public AshTestBase {
return id;
}
+ void SetShelfItemTypeToAppShortcut(ShelfID id) {
+ int index = model_->ItemIndexByID(id);
+ DCHECK_GE(index, 0);
+
+ ShelfItem item = model_->items()[index];
+
+ if (item.type == TYPE_PLATFORM_APP || item.type == TYPE_WINDOWED_APP) {
+ item.type = TYPE_APP_SHORTCUT;
+ model_->Set(index, item);
+ }
+ test_api_->RunMessageLoopUntilAnimationsDone();
+ }
+
void RemoveByID(ShelfID id) {
model_->RemoveItemAt(model_->ItemIndexByID(id));
test_api_->RunMessageLoopUntilAnimationsDone();
@@ -1816,6 +1829,22 @@ TEST_F(ShelfViewTest, CheckDragAndDropFromOverflowBubbleToShelf) {
TestDraggingAnItemFromOverflowToShelf(true);
}
+// Checks creating app shortcut for an opened platform app in overflow bubble
+// should be invisible to the shelf. See crbug.com/605793.
+TEST_F(ShelfViewTest, CheckOverflowStatusPinOpenedAppToShelf) {
+ AddButtonsUntilOverflow();
+
+ // Add a running Platform app.
+ ShelfID platform_app_id = AddPlatformApp();
+ EXPECT_FALSE(GetButtonByID(platform_app_id)->visible());
+
+ // Make the added running platform app to be an app shortcut.
+ // This app shortcut should be a swapped view in overflow bubble, which is
+ // invisible.
+ SetShelfItemTypeToAppShortcut(platform_app_id);
+ EXPECT_FALSE(GetButtonByID(platform_app_id)->visible());
+}
+
// Tests that the AppListButton renders as active in response to touches.
TEST_F(ShelfViewTest, AppListButtonTouchFeedback) {
AppListButton* app_list_button =
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698