Index: ui/app_list/views/app_list_main_view_unittest.cc |
diff --git a/ui/app_list/views/app_list_main_view_unittest.cc b/ui/app_list/views/app_list_main_view_unittest.cc |
index 0091e06f2023d53b93107425062a5e6e6ead484c..9de87fdc51eea3c376c779d14c11dede4f43397a 100644 |
--- a/ui/app_list/views/app_list_main_view_unittest.cc |
+++ b/ui/app_list/views/app_list_main_view_unittest.cc |
@@ -264,12 +264,9 @@ TEST_F(AppListMainViewTest, DragLastItemFromFolderAndDropAtLastSlot) { |
drop_target_tile.Offset(first_slot_tile.width() * 2, 0); |
gfx::Point point = drop_target_tile.CenterPoint(); |
SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); |
- SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); |
- base::RunLoop().RunUntilIdle(); |
// Drop it. |
FolderGridView()->EndDrag(false); |
- base::RunLoop().RunUntilIdle(); |
// Folder icon view should be gone and there is only one item view. |
EXPECT_EQ(1, RootViewModel()->view_size()); |
@@ -286,6 +283,35 @@ TEST_F(AppListMainViewTest, DragLastItemFromFolderAndDropAtLastSlot) { |
delegate_->GetTestModel()->FindFolderItem("single_item_folder")); |
} |
+// Tests dragging an item out of a single item folder and dropping it onto the |
+// page switcher. Regression test for http://crbug.com/415530/. |
+TEST_F(AppListMainViewTest, DragReparentItemOntoPageSwitcher) { |
+ AppListItemView* folder_item_view = CreateAndOpenSingleItemFolder(); |
+ const gfx::Rect first_slot_tile = folder_item_view->bounds(); |
+ |
+ delegate_->GetTestModel()->PopulateApps(20); |
+ |
+ EXPECT_EQ(1, FolderViewModel()->view_size()); |
+ EXPECT_EQ(21, RootViewModel()->view_size()); |
+ |
+ AppListItemView* dragged = StartDragForReparent(0); |
+ |
+ gfx::Rect main_view_bounds = main_view_->bounds(); |
+ // Drag the reparent item to the page switcher. |
+ gfx::Point point = |
+ gfx::Point(main_view_bounds.width() / 2, |
+ main_view_bounds.bottom() - first_slot_tile.height()); |
+ SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); |
+ |
+ // Drop it. |
+ FolderGridView()->EndDrag(false); |
+ |
+ // The folder should be destroyed. |
+ EXPECT_EQ(21, RootViewModel()->view_size()); |
+ EXPECT_EQ(NULL, |
+ delegate_->GetTestModel()->FindFolderItem("single_item_folder")); |
+} |
+ |
// Test that an interrupted drag while reparenting an item from a folder, when |
// canceled via the root grid, correctly forwards the cancelation to the drag |
// ocurring from the folder. |