Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1340)

Unified Diff: ui/views/corewm/tooltip_controller_unittest.cc

Issue 23477022: Two changes to desktop aura for tooltips: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2013 Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/corewm/tooltip_controller.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/corewm/tooltip_controller_unittest.cc
diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc
index 5cb3fe6b9dbf6d5f3dbf232fdf0bb52b0d2b4fa7..2ea2129f78ff12de2255e6eda0ba50f45a4549e4 100644
--- a/ui/views/corewm/tooltip_controller_unittest.cc
+++ b/ui/views/corewm/tooltip_controller_unittest.cc
@@ -409,6 +409,23 @@ TEST_F(TooltipControllerTest, TooltipHidesOnTimeoutAndStaysHiddenUntilChange) {
EXPECT_EQ(window, helper_->GetTooltipWindow());
}
+// Verifies a mouse exit event hides the tooltips.
+TEST_F(TooltipControllerTest, HideOnExit) {
+ view_->set_tooltip_text(ASCIIToUTF16("Tooltip Text"));
+ generator_->MoveMouseToCenterOf(GetWindow());
+ string16 expected_tooltip = ASCIIToUTF16("Tooltip Text");
+ EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(GetWindow()));
+ EXPECT_EQ(string16(), helper_->GetTooltipText());
+ EXPECT_EQ(GetWindow(), helper_->GetTooltipWindow());
+
+ // Fire tooltip timer so tooltip becomes visible.
+ helper_->FireTooltipTimer();
+
+ EXPECT_TRUE(helper_->IsTooltipVisible());
+ generator_->SendMouseExit();
+ EXPECT_FALSE(helper_->IsTooltipVisible());
+}
+
} // namespace test
} // namespace corewm
} // namespace views
« no previous file with comments | « ui/views/corewm/tooltip_controller.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698