| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 AppListItemView* folder_item_view = | 200 AppListItemView* folder_item_view = |
| 201 static_cast<AppListItemView*>(RootViewModel()->view_at(0)); | 201 static_cast<AppListItemView*>(RootViewModel()->view_at(0)); |
| 202 EXPECT_EQ(folder_item_view->item(), folder_item); | 202 EXPECT_EQ(folder_item_view->item(), folder_item); |
| 203 | 203 |
| 204 // Click on the folder to open it. | 204 // Click on the folder to open it. |
| 205 EXPECT_FALSE(FolderView()->visible()); | 205 EXPECT_FALSE(FolderView()->visible()); |
| 206 SimulateClick(folder_item_view); | 206 SimulateClick(folder_item_view); |
| 207 base::RunLoop().RunUntilIdle(); | 207 base::RunLoop().RunUntilIdle(); |
| 208 EXPECT_TRUE(FolderView()->visible()); | 208 EXPECT_TRUE(FolderView()->visible()); |
| 209 | 209 |
| 210 #if defined(OS_WIN) | |
| 211 AppsGridViewTestApi folder_grid_view_test_api(FolderGridView()); | |
| 212 folder_grid_view_test_api.DisableSynchronousDrag(); | |
| 213 #endif | |
| 214 return folder_item_view; | 210 return folder_item_view; |
| 215 } | 211 } |
| 216 | 212 |
| 217 AppListItemView* StartDragForReparent(int index_in_folder) { | 213 AppListItemView* StartDragForReparent(int index_in_folder) { |
| 218 // Start to drag the item in folder. | 214 // Start to drag the item in folder. |
| 219 views::View* item_view = FolderViewModel()->view_at(index_in_folder); | 215 views::View* item_view = FolderViewModel()->view_at(index_in_folder); |
| 220 gfx::Point point = item_view->bounds().CenterPoint(); | 216 gfx::Point point = item_view->bounds().CenterPoint(); |
| 221 AppListItemView* dragged = | 217 AppListItemView* dragged = |
| 222 SimulateInitiateDrag(FolderGridView(), AppsGridView::MOUSE, point); | 218 SimulateInitiateDrag(FolderGridView(), AppsGridView::MOUSE, point); |
| 223 EXPECT_EQ(item_view, dragged); | 219 EXPECT_EQ(item_view, dragged); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 // The app list model should remain unchanged. | 453 // The app list model should remain unchanged. |
| 458 EXPECT_EQ(1, FolderViewModel()->view_size()); | 454 EXPECT_EQ(1, FolderViewModel()->view_size()); |
| 459 EXPECT_EQ(2, RootViewModel()->view_size()); | 455 EXPECT_EQ(2, RootViewModel()->view_size()); |
| 460 EXPECT_EQ(folder_id, RootGridView()->GetItemViewAt(0)->item()->id()); | 456 EXPECT_EQ(folder_id, RootGridView()->GetItemViewAt(0)->item()->id()); |
| 461 EXPECT_NE(nullptr, | 457 EXPECT_NE(nullptr, |
| 462 delegate_->GetTestModel()->FindFolderItem("single_item_folder")); | 458 delegate_->GetTestModel()->FindFolderItem("single_item_folder")); |
| 463 } | 459 } |
| 464 | 460 |
| 465 } // namespace test | 461 } // namespace test |
| 466 } // namespace app_list | 462 } // namespace app_list |
| OLD | NEW |