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

Side by Side Diff: ash/wm/user_activity_detector_unittest.cc

Issue 11568006: events: Update scroll and touch handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-nit Created 8 years 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/wm/user_activity_detector.cc ('k') | ash/wm/window_modality_controller_unittest.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/wm/user_activity_detector.h" 5 #include "ash/wm/user_activity_detector.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/test/ash_test_base.h" 8 #include "ash/test/ash_test_base.h"
9 #include "ash/wm/user_activity_observer.h" 9 #include "ash/wm/user_activity_observer.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 detector_->OnAllOutputsTurnedOff(); 110 detector_->OnAllOutputsTurnedOff();
111 AdvanceTime(advance_delta); 111 AdvanceTime(advance_delta);
112 EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnMouseEvent(&mouse_event)); 112 EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnMouseEvent(&mouse_event));
113 EXPECT_EQ(0, observer_->num_invocations()); 113 EXPECT_EQ(0, observer_->num_invocations());
114 observer_->reset_stats(); 114 observer_->reset_stats();
115 115
116 AdvanceTime(advance_delta); 116 AdvanceTime(advance_delta);
117 ui::TouchEvent touch_event( 117 ui::TouchEvent touch_event(
118 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta()); 118 ui::ET_TOUCH_PRESSED, gfx::Point(), 0, base::TimeDelta());
119 SetEventTarget(window.get(), &touch_event); 119 SetEventTarget(window.get(), &touch_event);
120 EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnTouchEvent(&touch_event)); 120 detector_->OnTouchEvent(&touch_event);
121 EXPECT_FALSE(touch_event.handled());
121 EXPECT_EQ(1, observer_->num_invocations()); 122 EXPECT_EQ(1, observer_->num_invocations());
122 observer_->reset_stats(); 123 observer_->reset_stats();
123 124
124 AdvanceTime(advance_delta); 125 AdvanceTime(advance_delta);
125 ui::GestureEvent gesture_event( 126 ui::GestureEvent gesture_event(
126 ui::ET_GESTURE_TAP, 0, 0, ui::EF_NONE, 127 ui::ET_GESTURE_TAP, 0, 0, ui::EF_NONE,
127 base::TimeDelta::FromMilliseconds(base::Time::Now().ToDoubleT() * 1000), 128 base::TimeDelta::FromMilliseconds(base::Time::Now().ToDoubleT() * 1000),
128 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0, 0), 0U); 129 ui::GestureEventDetails(ui::ET_GESTURE_TAP, 0, 0), 0U);
129 SetEventTarget(window.get(), &gesture_event); 130 SetEventTarget(window.get(), &gesture_event);
130 detector_->OnGestureEvent(&gesture_event); 131 detector_->OnGestureEvent(&gesture_event);
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(12345)); 173 scoped_ptr<aura::Window> window(CreateTestWindowInShellWithId(12345));
173 ui::MouseEvent mouse_event( 174 ui::MouseEvent mouse_event(
174 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EF_IS_SYNTHESIZED); 175 ui::ET_MOUSE_MOVED, gfx::Point(), gfx::Point(), ui::EF_IS_SYNTHESIZED);
175 SetEventTarget(window.get(), &mouse_event); 176 SetEventTarget(window.get(), &mouse_event);
176 EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnMouseEvent(&mouse_event)); 177 EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnMouseEvent(&mouse_event));
177 EXPECT_EQ(0, observer_->num_invocations()); 178 EXPECT_EQ(0, observer_->num_invocations());
178 } 179 }
179 180
180 } // namespace test 181 } // namespace test
181 } // namespace ash 182 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/user_activity_detector.cc ('k') | ash/wm/window_modality_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698