| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 285 |
| 286 generator.MoveMouseTo(item1->GetBoundsInScreen().CenterPoint()); | 286 generator.MoveMouseTo(item1->GetBoundsInScreen().CenterPoint()); |
| 287 EXPECT_FALSE(item0->is_highlighted()); | 287 EXPECT_FALSE(item0->is_highlighted()); |
| 288 EXPECT_TRUE(item1->is_highlighted()); | 288 EXPECT_TRUE(item1->is_highlighted()); |
| 289 | 289 |
| 290 generator.MoveMouseTo(gfx::Point(-1, -1)); | 290 generator.MoveMouseTo(gfx::Point(-1, -1)); |
| 291 EXPECT_FALSE(item0->is_highlighted()); | 291 EXPECT_FALSE(item0->is_highlighted()); |
| 292 EXPECT_FALSE(item1->is_highlighted()); | 292 EXPECT_FALSE(item1->is_highlighted()); |
| 293 } | 293 } |
| 294 | 294 |
| 295 // No touch on desktop Mac. Tracked in http://crbug.com/445520. | |
| 296 #if defined(OS_MACOSX) && !defined(USE_AURA) | |
| 297 #define MAYBE_TapGestureToHighlight DISABLED_TapGestureToHighlight | |
| 298 #else | |
| 299 #define MAYBE_TapGestureToHighlight TapGestureToHighlight | |
| 300 #endif | |
| 301 | |
| 302 // Tests that tap gesture on app item highlights it | 295 // Tests that tap gesture on app item highlights it |
| 303 TEST_F(AppListMainViewTest, MAYBE_TapGestureToHighlight) { | 296 TEST_F(AppListMainViewTest, TapGestureToHighlight) { |
| 304 delegate_->GetTestModel()->PopulateApps(1); | 297 delegate_->GetTestModel()->PopulateApps(1); |
| 305 main_widget_->Show(); | 298 main_widget_->Show(); |
| 306 | 299 |
| 307 ui::test::EventGenerator generator(GetContext(), | 300 ui::test::EventGenerator generator(GetContext(), |
| 308 main_widget_->GetNativeWindow()); | 301 main_widget_->GetNativeWindow()); |
| 309 AppListItemView* item = RootViewModel()->view_at(0); | 302 AppListItemView* item = RootViewModel()->view_at(0); |
| 310 | 303 |
| 311 // Switch to All Apps page. | 304 // Switch to All Apps page. |
| 312 GetContentsView()->SetActiveState(AppListModel::STATE_APPS); | 305 GetContentsView()->SetActiveState(AppListModel::STATE_APPS); |
| 313 GetContentsView()->Layout(); | 306 GetContentsView()->Layout(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // The app list model should remain unchanged. | 442 // The app list model should remain unchanged. |
| 450 EXPECT_EQ(1, FolderViewModel()->view_size()); | 443 EXPECT_EQ(1, FolderViewModel()->view_size()); |
| 451 EXPECT_EQ(2, RootViewModel()->view_size()); | 444 EXPECT_EQ(2, RootViewModel()->view_size()); |
| 452 EXPECT_EQ(folder_id, RootGridView()->GetItemViewAt(0)->item()->id()); | 445 EXPECT_EQ(folder_id, RootGridView()->GetItemViewAt(0)->item()->id()); |
| 453 EXPECT_NE(nullptr, | 446 EXPECT_NE(nullptr, |
| 454 delegate_->GetTestModel()->FindFolderItem("single_item_folder")); | 447 delegate_->GetTestModel()->FindFolderItem("single_item_folder")); |
| 455 } | 448 } |
| 456 | 449 |
| 457 } // namespace test | 450 } // namespace test |
| 458 } // namespace app_list | 451 } // namespace app_list |
| OLD | NEW |