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

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

Issue 2652353003: Fix regression: empty tooltip appears in Linux and Chrome OS (Closed)
Patch Set: More accurate timer API. Created 3 years, 11 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') | no next file » | 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 97a33512264a5c2deb4619b1815a55520e35487d..2f48dbe3e7bfc710953b009291036032f37e69ed 100644
--- a/ui/views/corewm/tooltip_controller_unittest.cc
+++ b/ui/views/corewm/tooltip_controller_unittest.cc
@@ -206,6 +206,25 @@ TEST_F(TooltipControllerTest, ViewTooltip) {
EXPECT_EQ(GetWindow(), helper_->GetTooltipWindow());
}
+TEST_F(TooltipControllerTest, HideEmptyTooltip) {
+ // TODO: these tests use GetContext(). That should go away for aura-mus
+ // client. http://crbug.com/663781.
+ if (IsMus())
+ return;
+
+ view_->set_tooltip_text(ASCIIToUTF16("Tooltip Text"));
+ EXPECT_EQ(base::string16(), helper_->GetTooltipText());
+ EXPECT_EQ(NULL, helper_->GetTooltipWindow());
+
+ generator_->MoveMouseToCenterOf(GetWindow());
+ generator_->MoveMouseBy(1, 0);
+ EXPECT_TRUE(helper_->IsTooltipVisible());
+
+ view_->set_tooltip_text(ASCIIToUTF16(" "));
+ generator_->MoveMouseBy(1, 0);
+ EXPECT_FALSE(helper_->IsTooltipVisible());
+}
+
#if defined(OS_CHROMEOS)
// crbug.com/664370.
TEST_F(TooltipControllerTest, MaxWidth) {
« no previous file with comments | « ui/views/corewm/tooltip_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698