OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/apps_grid_view.h" | 5 #include "ui/app_list/apps_grid_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 SimulateDrag(AppsGridView::MOUSE, from, to); | 281 SimulateDrag(AppsGridView::MOUSE, from, to); |
282 model_->apps()->Add(CreateItem(std::string("Extra"))); | 282 model_->apps()->Add(CreateItem(std::string("Extra"))); |
283 apps_grid_view_->EndDrag(false); | 283 apps_grid_view_->EndDrag(false); |
284 EXPECT_EQ(std::string("Item 1,Item 2,Item 3,Extra"), | 284 EXPECT_EQ(std::string("Item 1,Item 2,Item 3,Extra"), |
285 GetModelContent()); | 285 GetModelContent()); |
286 test_api_->LayoutToIdealBounds(); | 286 test_api_->LayoutToIdealBounds(); |
287 } | 287 } |
288 | 288 |
289 TEST_F(AppsGridViewTest, MouseDragFlipPage) { | 289 TEST_F(AppsGridViewTest, MouseDragFlipPage) { |
290 test_api_->SetPageFlipDelay(10); | 290 test_api_->SetPageFlipDelay(10); |
291 pagination_model_->SetTransitionDuration(10); | 291 pagination_model_->SetTransitionDurations(10, 10); |
292 | 292 |
293 PageFlipWaiter page_flip_waiter(&message_loop_, | 293 PageFlipWaiter page_flip_waiter(&message_loop_, |
294 pagination_model_.get()); | 294 pagination_model_.get()); |
295 | 295 |
296 const int kPages = 3; | 296 const int kPages = 3; |
297 PopulateApps(kPages * kTilesPerPage); | 297 PopulateApps(kPages * kTilesPerPage); |
298 EXPECT_EQ(kPages, pagination_model_->total_pages()); | 298 EXPECT_EQ(kPages, pagination_model_->total_pages()); |
299 EXPECT_EQ(0, pagination_model_->selected_page()); | 299 EXPECT_EQ(0, pagination_model_->selected_page()); |
300 | 300 |
301 gfx::Point from = GetItemTileRectAt(0, 0).CenterPoint(); | 301 gfx::Point from = GetItemTileRectAt(0, 0).CenterPoint(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 SimulateDrag(AppsGridView::MOUSE, mouse_from, mouse_to); | 361 SimulateDrag(AppsGridView::MOUSE, mouse_from, mouse_to); |
362 // Finishes the drag and touch drag wins. | 362 // Finishes the drag and touch drag wins. |
363 apps_grid_view_->EndDrag(false); | 363 apps_grid_view_->EndDrag(false); |
364 EXPECT_EQ(std::string("Item 1,Item 0,Item 3,Item 2"), | 364 EXPECT_EQ(std::string("Item 1,Item 0,Item 3,Item 2"), |
365 GetModelContent()); | 365 GetModelContent()); |
366 test_api_->LayoutToIdealBounds(); | 366 test_api_->LayoutToIdealBounds(); |
367 } | 367 } |
368 | 368 |
369 } // namespace test | 369 } // namespace test |
370 } // namespace app_list | 370 } // namespace app_list |
OLD | NEW |