Index: ash/launcher/launcher_view_unittest.cc |
diff --git a/ash/launcher/launcher_view_unittest.cc b/ash/launcher/launcher_view_unittest.cc |
index 51e1af0d1920a230c4345d51eb42722f354d4011..5868352eb9a27cce8c9960ec4427fd7d1bdbf456 100644 |
--- a/ash/launcher/launcher_view_unittest.cc |
+++ b/ash/launcher/launcher_view_unittest.cc |
@@ -167,13 +167,13 @@ class MockLauncherDelegate : public ash::LauncherDelegate { |
} |
}; |
-class LauncherViewTest : public aura::test::AuraTestBase { |
+class LauncherViewTest : public AshTestBase { |
public: |
LauncherViewTest() {} |
virtual ~LauncherViewTest() {} |
virtual void SetUp() OVERRIDE { |
- aura::test::AuraTestBase::SetUp(); |
+ AshTestBase::SetUp(); |
model_.reset(new LauncherModel); |
@@ -187,6 +187,11 @@ class LauncherViewTest : public aura::test::AuraTestBase { |
test_api_->SetAnimationDuration(1); // Speeds up animation for test. |
} |
+ virtual void TearDown() OVERRIDE { |
+ launcher_view_.reset(); |
+ AshTestBase::TearDown(); |
+ } |
+ |
protected: |
LauncherID AddAppShortcut() { |
LauncherItem item; |
@@ -651,6 +656,24 @@ TEST_F(LauncherViewTest, ShouldHideTooltipTest) { |
gfx::Point(all_area.x(), all_area.bottom()))); |
} |
+TEST_F(LauncherViewTest, ShouldHideTooltipWithAppListWindowTest) { |
+ Shell::GetInstance()->ToggleAppList(); |
+ ASSERT_TRUE(Shell::GetInstance()->GetAppListWindow()); |
+ |
+ // The tooltip shouldn't hide if the mouse is on normal buttons. |
+ for (int i = 0; i < test_api_->GetButtonCount() - 1; i++) { |
+ internal::LauncherButton* button = test_api_->GetButton(i); |
+ EXPECT_FALSE(launcher_view_->ShouldHideTooltip( |
+ button->GetMirroredBounds().CenterPoint())) |
+ << "LauncherView tries to hide on button " << i; |
+ } |
+ |
+ // The tooltip should hide on the app-list button. |
+ views::View* app_list_button = launcher_view_->GetAppListButtonView(); |
+ EXPECT_TRUE(launcher_view_->ShouldHideTooltip( |
+ app_list_button->GetMirroredBounds().CenterPoint())); |
+} |
+ |
// Resizing launcher view while an add animation without fade-in is running, |
// which happens when overflow happens. App list button should end up in its |
// new ideal bounds. |