| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/app_list/views/app_list_main_view.h" | 5 #include "ui/app_list/views/app_list_main_view.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 TEST_F(AppListMainViewTest, DragLastItemFromFolderAndDropAtLastSlot) { | 254 TEST_F(AppListMainViewTest, DragLastItemFromFolderAndDropAtLastSlot) { |
| 255 AppListItemView* folder_item_view = CreateAndOpenSingleItemFolder(); | 255 AppListItemView* folder_item_view = CreateAndOpenSingleItemFolder(); |
| 256 const gfx::Rect first_slot_tile = folder_item_view->bounds(); | 256 const gfx::Rect first_slot_tile = folder_item_view->bounds(); |
| 257 | 257 |
| 258 EXPECT_EQ(1, FolderViewModel()->view_size()); | 258 EXPECT_EQ(1, FolderViewModel()->view_size()); |
| 259 | 259 |
| 260 AppListItemView* dragged = StartDragForReparent(0); | 260 AppListItemView* dragged = StartDragForReparent(0); |
| 261 | 261 |
| 262 // Drop it to the slot on the right of first slot. | 262 // Drop it to the slot on the right of first slot. |
| 263 gfx::Rect drop_target_tile(first_slot_tile); | 263 gfx::Rect drop_target_tile(first_slot_tile); |
| 264 drop_target_tile.Offset(first_slot_tile.width(), 0); | 264 drop_target_tile.Offset(first_slot_tile.width() * 2, 0); |
| 265 gfx::Point point = drop_target_tile.CenterPoint(); | 265 gfx::Point point = drop_target_tile.CenterPoint(); |
| 266 SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); | 266 SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); |
| 267 SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); | 267 SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); |
| 268 base::RunLoop().RunUntilIdle(); | 268 base::RunLoop().RunUntilIdle(); |
| 269 | 269 |
| 270 // Drop it. | 270 // Drop it. |
| 271 FolderGridView()->EndDrag(false); | 271 FolderGridView()->EndDrag(false); |
| 272 base::RunLoop().RunUntilIdle(); | 272 base::RunLoop().RunUntilIdle(); |
| 273 | 273 |
| 274 // Folder icon view should be gone and there is only one item view. | 274 // Folder icon view should be gone and there is only one item view. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 304 | 304 |
| 305 // Additional mouse move operations should be ignored. | 305 // Additional mouse move operations should be ignored. |
| 306 gfx::Point point(1, 1); | 306 gfx::Point point(1, 1); |
| 307 SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); | 307 SimulateUpdateDrag(FolderGridView(), AppsGridView::MOUSE, dragged, point); |
| 308 EXPECT_FALSE(RootGridView()->has_dragged_view()); | 308 EXPECT_FALSE(RootGridView()->has_dragged_view()); |
| 309 EXPECT_FALSE(FolderGridView()->has_dragged_view()); | 309 EXPECT_FALSE(FolderGridView()->has_dragged_view()); |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace test | 312 } // namespace test |
| 313 } // namespace app_list | 313 } // namespace app_list |
| OLD | NEW |