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

Unified Diff: ash/wm/user_activity_detector_unittest.cc

Issue 11570012: events: Update key-event handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-for-landing 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/user_activity_detector.cc ('k') | ash/wm/window_cycle_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/user_activity_detector_unittest.cc
diff --git a/ash/wm/user_activity_detector_unittest.cc b/ash/wm/user_activity_detector_unittest.cc
index 1e3105bdf26af42c29daaf4a568ba2db1c5374cd..979c9eaab306684fe603f1bf4f8957fd21b1f5e0 100644
--- a/ash/wm/user_activity_detector_unittest.cc
+++ b/ash/wm/user_activity_detector_unittest.cc
@@ -92,7 +92,8 @@ TEST_F(UserActivityDetectorTest, Basic) {
ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false);
SetEventTarget(window.get(), &key_event);
- EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnKeyEvent(&key_event));
+ detector_->OnKeyEvent(&key_event);
+ EXPECT_FALSE(key_event.handled());
EXPECT_EQ(1, observer_->num_invocations());
observer_->reset_stats();
@@ -141,13 +142,15 @@ TEST_F(UserActivityDetectorTest, RateLimitNotifications) {
// The observer should be notified about a key event.
ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false);
SetEventTarget(window.get(), &event);
- EXPECT_FALSE(detector_->OnKeyEvent(&event));
+ detector_->OnKeyEvent(&event);
+ EXPECT_FALSE(event.handled());
EXPECT_EQ(1, observer_->num_invocations());
observer_->reset_stats();
// It shouldn't be notified if a second event occurs
// in the same instant in time.
- EXPECT_FALSE(detector_->OnKeyEvent(&event));
+ detector_->OnKeyEvent(&event);
+ EXPECT_FALSE(event.handled());
EXPECT_EQ(0, observer_->num_invocations());
observer_->reset_stats();
@@ -155,7 +158,8 @@ TEST_F(UserActivityDetectorTest, RateLimitNotifications) {
AdvanceTime(
base::TimeDelta::FromMilliseconds(
UserActivityDetector::kNotifyIntervalMs - 100));
- EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnKeyEvent(&event));
+ detector_->OnKeyEvent(&event);
+ EXPECT_FALSE(event.handled());
EXPECT_EQ(0, observer_->num_invocations());
observer_->reset_stats();
@@ -164,7 +168,8 @@ TEST_F(UserActivityDetectorTest, RateLimitNotifications) {
AdvanceTime(base::TimeDelta::FromMilliseconds(
UserActivityDetector::kNotifyIntervalMs));
- EXPECT_EQ(ui::ER_UNHANDLED, detector_->OnKeyEvent(&event));
+ detector_->OnKeyEvent(&event);
+ EXPECT_FALSE(event.handled());
EXPECT_EQ(1, observer_->num_invocations());
}
« no previous file with comments | « ash/wm/user_activity_detector.cc ('k') | ash/wm/window_cycle_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698