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

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

Issue 10912063: events: Get rid of GestureStatus in favour of EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/launcher/launcher_tooltip_manager.cc ('k') | ash/launcher/launcher_view.h » ('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/test/ash_test_base.h" 7 #include "ash/test/ash_test_base.h"
8 #include "ash/wm/shelf_layout_manager.h" 8 #include "ash/wm/shelf_layout_manager.h"
9 #include "ash/wm/window_util.h" 9 #include "ash/wm/window_util.h"
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN, 158 EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN,
159 event_filter->PreHandleTouchEvent( 159 event_filter->PreHandleTouchEvent(
160 tooltip_widget->GetNativeWindow(), &touch_event)); 160 tooltip_widget->GetNativeWindow(), &touch_event));
161 EXPECT_TRUE(TooltipIsVisible()); 161 EXPECT_TRUE(TooltipIsVisible());
162 162
163 // Should hide for gesture events. 163 // Should hide for gesture events.
164 ui::GestureEvent gesture_event( 164 ui::GestureEvent gesture_event(
165 ui::ET_GESTURE_BEGIN, 0, 0, ui::EF_NONE, 165 ui::ET_GESTURE_BEGIN, 0, 0, ui::EF_NONE,
166 base::TimeDelta::FromMilliseconds(base::Time::Now().ToDoubleT() * 1000), 166 base::TimeDelta::FromMilliseconds(base::Time::Now().ToDoubleT() * 1000),
167 ui::GestureEventDetails(ui::ET_GESTURE_BEGIN, 0.0f, 0.0f), 0); 167 ui::GestureEventDetails(ui::ET_GESTURE_BEGIN, 0.0f, 0.0f), 0);
168 EXPECT_EQ(ui::GESTURE_STATUS_UNKNOWN, 168 EXPECT_EQ(ui::ER_UNHANDLED,
169 event_filter->PreHandleGestureEvent(root_window, &gesture_event)); 169 event_filter->PreHandleGestureEvent(root_window, &gesture_event));
170 RunAllPendingInMessageLoop(); 170 RunAllPendingInMessageLoop();
171 EXPECT_FALSE(TooltipIsVisible()); 171 EXPECT_FALSE(TooltipIsVisible());
172 } 172 }
173 173
174 TEST_F(LauncherTooltipManagerTest, HideForMouseEvent) { 174 TEST_F(LauncherTooltipManagerTest, HideForMouseEvent) {
175 ShowImmediately(); 175 ShowImmediately();
176 ASSERT_TRUE(TooltipIsVisible()); 176 ASSERT_TRUE(TooltipIsVisible());
177 177
178 aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow(); 178 aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
(...skipping 12 matching lines...) Expand all
191 191
192 // Should hide if the mouse is out of the tooltip. 192 // Should hide if the mouse is out of the tooltip.
193 test_api.set_location(tooltip_rect.origin().Add(gfx::Point(-1, -1))); 193 test_api.set_location(tooltip_rect.origin().Add(gfx::Point(-1, -1)));
194 EXPECT_FALSE(event_filter->PreHandleMouseEvent(root_window, &mouse_event)); 194 EXPECT_FALSE(event_filter->PreHandleMouseEvent(root_window, &mouse_event));
195 RunAllPendingInMessageLoop(); 195 RunAllPendingInMessageLoop();
196 EXPECT_FALSE(TooltipIsVisible()); 196 EXPECT_FALSE(TooltipIsVisible());
197 } 197 }
198 198
199 } // namespace test 199 } // namespace test
200 } // namespace ash 200 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_tooltip_manager.cc ('k') | ash/launcher/launcher_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698