From 5657bc22e55a5d9bc4e5cb63e9b4b0ffc55ed377 Mon Sep 17 00:00:00 2001 From: tapted Date: Tue, 13 Jan 2015 16:46:30 -0800 Subject: [PATCH] MacViews: Fix app_list_unittests for mouseover change in r311143 Compile of app_list_unittests on toolkit-views enabled Mac regressed in r311143 because it accessed aura::Window and there is no Aura on Mac yet. The MouseHoverToHighlight passes on Mac - it just needs to initialize the event generator differently. TapGestureToHighlight is disabled on Mac, since there are no touch events on desktop Mac. BUG=441573, 445520, 365977 Review URL: https://codereview.chromium.org/840373003 Cr-Commit-Position: refs/heads/master@{#311375} --- ui/app_list/views/app_list_main_view_unittest.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) 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 bd21330ead59..292568e2d7c6 100644 --- a/ui/app_list/views/app_list_main_view_unittest.cc +++ b/ui/app_list/views/app_list_main_view_unittest.cc @@ -273,8 +273,8 @@ TEST_F(AppListMainViewTest, MouseHoverToHighlight) { delegate_->GetTestModel()->PopulateApps(2); main_widget_->Show(); - ui::test::EventGenerator generator( - main_widget_->GetNativeWindow()->GetRootWindow()); + ui::test::EventGenerator generator(GetContext(), + main_widget_->GetNativeWindow()); AppListItemView* item0 = RootViewModel()->view_at(0); AppListItemView* item1 = RootViewModel()->view_at(1); @@ -298,13 +298,20 @@ TEST_F(AppListMainViewTest, MouseHoverToHighlight) { EXPECT_FALSE(item1->is_highlighted()); } +// No touch on desktop Mac. Tracked in http://crbug.com/445520. +#if defined(OS_MACOSX) && !defined(USE_AURA) +#define MAYBE_TapGestureToHighlight DISABLED_TapGestureToHighlight +#else +#define MAYBE_TapGestureToHighlight TapGestureToHighlight +#endif + // Tests that tap gesture on app item highlights it -TEST_F(AppListMainViewTest, TapGestureToHighlight) { +TEST_F(AppListMainViewTest, MAYBE_TapGestureToHighlight) { delegate_->GetTestModel()->PopulateApps(1); main_widget_->Show(); - ui::test::EventGenerator generator( - main_widget_->GetNativeWindow()->GetRootWindow()); + ui::test::EventGenerator generator(GetContext(), + main_widget_->GetNativeWindow()); AppListItemView* item = RootViewModel()->view_at(0); // If experimental launcher, switch to All Apps page -- 2.11.4.GIT