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

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

Issue 10831240: Remove TouchEvent interface, and rename TouchEventImpl to TouchEvent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge-tot Created 8 years, 4 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/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/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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow(); 140 aura::RootWindow* root_window = Shell::GetInstance()->GetPrimaryRootWindow();
141 aura::EventFilter* event_filter = GetEventFilter(); 141 aura::EventFilter* event_filter = GetEventFilter();
142 142
143 // Should not hide for key events. 143 // Should not hide for key events.
144 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE); 144 ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE);
145 EXPECT_FALSE(event_filter->PreHandleKeyEvent(root_window, &key_event)); 145 EXPECT_FALSE(event_filter->PreHandleKeyEvent(root_window, &key_event));
146 EXPECT_TRUE(TooltipIsVisible()); 146 EXPECT_TRUE(TooltipIsVisible());
147 147
148 // Should hide for touch events. 148 // Should hide for touch events.
149 ui::TouchEventImpl touch_event( 149 ui::TouchEvent touch_event(
150 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); 150 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta());
151 EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN, 151 EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN,
152 event_filter->PreHandleTouchEvent(root_window, &touch_event)); 152 event_filter->PreHandleTouchEvent(root_window, &touch_event));
153 EXPECT_FALSE(TooltipIsVisible()); 153 EXPECT_FALSE(TooltipIsVisible());
154 154
155 // Shouldn't hide if the touch happens on the tooltip. 155 // Shouldn't hide if the touch happens on the tooltip.
156 ShowImmediately(); 156 ShowImmediately();
157 views::Widget* tooltip_widget = GetTooltipWidget(); 157 views::Widget* tooltip_widget = GetTooltipWidget();
158 EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN, 158 EXPECT_EQ(ui::TOUCH_STATUS_UNKNOWN,
159 event_filter->PreHandleTouchEvent( 159 event_filter->PreHandleTouchEvent(
(...skipping 30 matching lines...) Expand all
190 190
191 // Should hide if the mouse is out of the tooltip. 191 // Should hide if the mouse is out of the tooltip.
192 test_api.set_location(tooltip_rect.origin().Add(gfx::Point(-1, -1))); 192 test_api.set_location(tooltip_rect.origin().Add(gfx::Point(-1, -1)));
193 EXPECT_FALSE(event_filter->PreHandleMouseEvent(root_window, &mouse_event)); 193 EXPECT_FALSE(event_filter->PreHandleMouseEvent(root_window, &mouse_event));
194 RunAllPendingInMessageLoop(); 194 RunAllPendingInMessageLoop();
195 EXPECT_FALSE(TooltipIsVisible()); 195 EXPECT_FALSE(TooltipIsVisible());
196 } 196 }
197 197
198 } // namespace test 198 } // namespace test
199 } // namespace ash 199 } // 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