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

Unified Diff: ash/shelf/shelf_tooltip_manager_unittest.cc

Issue 1834203003: Revert of Refine ash shelf tooltip closing on non-mash ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « ash/shelf/shelf_tooltip_manager.cc ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_tooltip_manager_unittest.cc
diff --git a/ash/shelf/shelf_tooltip_manager_unittest.cc b/ash/shelf/shelf_tooltip_manager_unittest.cc
index 7f6650ecb6eee268078c0726dff9af8882a8c805..3f2b2e884155399b0ed76938c1c737b54a04d9b1 100644
--- a/ash/shelf/shelf_tooltip_manager_unittest.cc
+++ b/ash/shelf/shelf_tooltip_manager_unittest.cc
@@ -173,40 +173,34 @@
EXPECT_FALSE(TooltipIsVisible());
}
-TEST_F(ShelfTooltipManagerTest, HideForExternalEvents) {
+// TODO(msw): Hiding for touch and gesture events outside the shelf is broken.
+TEST_F(ShelfTooltipManagerTest, HideForEventsBroken) {
ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
- // TODO(msw): Observe events outside the shelf in mash, to close tooltips.
- aura::Window* shelf_window = shelf_->shelf_widget()->GetNativeWindow();
- bool closes = shelf_window->GetRootWindow() == Shell::GetPrimaryRootWindow();
-
- // Should hide for touches outside the shelf.
- ShowImmediately();
- ASSERT_TRUE(TooltipIsVisible());
+
+ ShowImmediately();
+ ASSERT_TRUE(TooltipIsVisible());
+
generator.set_current_location(gfx::Point());
generator.PressTouch();
- EXPECT_EQ(TooltipIsVisible(), !closes);
-
- // Should hide for touch events on the tooltip.
- ShowImmediately();
- ASSERT_TRUE(TooltipIsVisible());
+ EXPECT_TRUE(TooltipIsVisible());
+
+ generator.GestureTapDownAndUp(gfx::Point());
+ EXPECT_TRUE(TooltipIsVisible());
+}
+
+TEST_F(ShelfTooltipManagerTest, DoNotHideForEvents) {
+ ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
+
+ ShowImmediately();
+ ASSERT_TRUE(TooltipIsVisible());
+
+ // Should not hide for key events.
+ generator.PressKey(ui::VKEY_A, ui::EF_NONE);
+ EXPECT_TRUE(TooltipIsVisible());
+
+ // Should not hide for touch events on the tooltip.
generator.set_current_location(GetTooltipWindow()->bounds().CenterPoint());
generator.PressTouch();
- EXPECT_EQ(TooltipIsVisible(), !closes);
-
- // Should hide for gestures outside the shelf.
- ShowImmediately();
- ASSERT_TRUE(TooltipIsVisible());
- generator.GestureTapDownAndUp(gfx::Point());
- EXPECT_EQ(TooltipIsVisible(), !closes);
-}
-
-TEST_F(ShelfTooltipManagerTest, DoNotHideForKeyEvents) {
- ui::test::EventGenerator generator(ash::Shell::GetPrimaryRootWindow());
-
- // Should not hide for key events.
- ShowImmediately();
- ASSERT_TRUE(TooltipIsVisible());
- generator.PressKey(ui::VKEY_A, ui::EF_NONE);
EXPECT_TRUE(TooltipIsVisible());
}
« no previous file with comments | « ash/shelf/shelf_tooltip_manager.cc ('k') | ash/shelf/shelf_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698