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

Side by Side Diff: ash/launcher/launcher_tooltip_manager_unittest.cc

Issue 11364062: ui: Remove TouchStatus in favour of EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/launcher/launcher_tooltip_manager.cc ('k') | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/launcher/launcher_tooltip_manager.h" 5 #include "ash/launcher/launcher_tooltip_manager.h"
6 6
7 #include "ash/root_window_controller.h" 7 #include "ash/root_window_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/test/ash_test_base.h" 9 #include "ash/test/ash_test_base.h"
10 #include "ash/wm/shelf_layout_manager.h" 10 #include "ash/wm/shelf_layout_manager.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 aura::EventFilter* event_filter = GetEventFilter(); 146 aura::EventFilter* event_filter = GetEventFilter();
147 147
148 // Should not hide for key events. 148 // Should not hide for key events.
149 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); 149 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false);
150 EXPECT_FALSE(event_filter->PreHandleKeyEvent(root_window, &key_event)); 150 EXPECT_FALSE(event_filter->PreHandleKeyEvent(root_window, &key_event));
151 EXPECT_TRUE(TooltipIsVisible()); 151 EXPECT_TRUE(TooltipIsVisible());
152 152
153 // Should hide for touch events. 153 // Should hide for touch events.
154 ui::TouchEvent touch_event( 154 ui::TouchEvent touch_event(
155 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); 155 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta());
156 EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN, 156 EXPECT_EQ(ui::ER_UNHANDLED,
157 event_filter->PreHandleTouchEvent(root_window, &touch_event)); 157 event_filter->PreHandleTouchEvent(root_window, &touch_event));
158 EXPECT_FALSE(TooltipIsVisible()); 158 EXPECT_FALSE(TooltipIsVisible());
159 159
160 // Shouldn't hide if the touch happens on the tooltip. 160 // Shouldn't hide if the touch happens on the tooltip.
161 ShowImmediately(); 161 ShowImmediately();
162 views::Widget* tooltip_widget = GetTooltipWidget(); 162 views::Widget* tooltip_widget = GetTooltipWidget();
163 EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN, 163 EXPECT_EQ(ui::ER_UNHANDLED,
164 event_filter->PreHandleTouchEvent( 164 event_filter->PreHandleTouchEvent(
165 tooltip_widget->GetNativeWindow(), &touch_event)); 165 tooltip_widget->GetNativeWindow(), &touch_event));
166 EXPECT_TRUE(TooltipIsVisible()); 166 EXPECT_TRUE(TooltipIsVisible());
167 167
168 // Should hide for gesture events. 168 // Should hide for gesture events.
169 ui::GestureEvent gesture_event( 169 ui::GestureEvent gesture_event(
170 ui::ET_GESTURE_BEGIN, 0, 0, ui::EF_NONE, 170 ui::ET_GESTURE_BEGIN, 0, 0, ui::EF_NONE,
171 base::TimeDelta::FromMilliseconds(base::Time::Now().ToDoubleT() * 1000), 171 base::TimeDelta::FromMilliseconds(base::Time::Now().ToDoubleT() * 1000),
172 ui::GestureEventDetails(ui::ET_GESTURE_BEGIN, 0.0f, 0.0f), 0); 172 ui::GestureEventDetails(ui::ET_GESTURE_BEGIN, 0.0f, 0.0f), 0);
173 EXPECT_EQ(ui::ER_UNHANDLED, 173 EXPECT_EQ(ui::ER_UNHANDLED,
(...skipping 22 matching lines...) Expand all
196 196
197 // Should hide if the mouse is out of the tooltip. 197 // Should hide if the mouse is out of the tooltip.
198 test_api.set_location(tooltip_rect.origin().Add(gfx::Vector2d(-1, -1))); 198 test_api.set_location(tooltip_rect.origin().Add(gfx::Vector2d(-1, -1)));
199 EXPECT_FALSE(event_filter->PreHandleMouseEvent(root_window, &mouse_event)); 199 EXPECT_FALSE(event_filter->PreHandleMouseEvent(root_window, &mouse_event));
200 RunAllPendingInMessageLoop(); 200 RunAllPendingInMessageLoop();
201 EXPECT_FALSE(TooltipIsVisible()); 201 EXPECT_FALSE(TooltipIsVisible());
202 } 202 }
203 203
204 } // namespace test 204 } // namespace test
205 } // namespace ash 205 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_tooltip_manager.cc ('k') | ash/magnifier/magnification_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698