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

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

Issue 2829653002: Removed (spurious, touch-initiated) tooltips from nav buttons (Closed)
Patch Set: Unit test cleanup Created 3 years, 8 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 2f48dbe3e7bfc710953b009291036032f37e69ed..37fe682b9dfe6179a0b1630935c34197530602e7 100644
--- a/ui/views/corewm/tooltip_controller_unittest.cc
+++ b/ui/views/corewm/tooltip_controller_unittest.cc
@@ -225,6 +225,32 @@ TEST_F(TooltipControllerTest, HideEmptyTooltip) {
EXPECT_FALSE(helper_->IsTooltipVisible());
}
+TEST_F(TooltipControllerTest, DontShowTooltipOnTouch) {
+ // 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(nullptr, helper_->GetTooltipWindow());
+
+ generator_->PressMoveAndReleaseTouchToCenterOf(GetWindow());
+ EXPECT_EQ(base::string16(), helper_->GetTooltipText());
+ EXPECT_EQ(nullptr, helper_->GetTooltipWindow());
+
+ generator_->MoveMouseToCenterOf(GetWindow());
+ EXPECT_EQ(base::string16(), helper_->GetTooltipText());
+ EXPECT_EQ(nullptr, helper_->GetTooltipWindow());
+
+ generator_->MoveMouseBy(1, 0);
+ EXPECT_TRUE(helper_->IsTooltipVisible());
+ base::string16 expected_tooltip = ASCIIToUTF16("Tooltip Text");
+ EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(GetWindow()));
+ EXPECT_EQ(expected_tooltip, helper_->GetTooltipText());
+ EXPECT_EQ(GetWindow(), helper_->GetTooltipWindow());
+}
+
#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