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

Side by Side Diff: ui/base/events/event_dispatcher_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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/base/events/event_handler.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 "ui/base/events/event_dispatcher.h" 5 #include "ui/base/events/event_dispatcher.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 } 73 }
74 } 74 }
75 75
76 void set_event_result(EventResult result) { event_result_ = result; } 76 void set_event_result(EventResult result) { event_result_ = result; }
77 77
78 void set_expect_pre_target(bool expect) { expect_pre_target_ = expect; } 78 void set_expect_pre_target(bool expect) { expect_pre_target_ = expect; }
79 void set_expect_post_target(bool expect) { expect_post_target_ = expect; } 79 void set_expect_post_target(bool expect) { expect_post_target_ = expect; }
80 80
81 private: 81 private:
82 // Overridden from EventHandler: 82 // Overridden from EventHandler:
83 virtual EventResult OnKeyEvent(KeyEvent* event) OVERRIDE { 83 virtual void OnKeyEvent(KeyEvent* event) OVERRIDE {
84 ReceivedEvent(event); 84 ReceivedEvent(event);
85 return event_result_; 85 SetStatusOnEvent(event);
86 } 86 }
87 87
88 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE { 88 virtual EventResult OnMouseEvent(MouseEvent* event) OVERRIDE {
89 ReceivedEvent(event); 89 ReceivedEvent(event);
90 return event_result_; 90 return event_result_;
91 } 91 }
92 92
93 virtual void OnScrollEvent(ScrollEvent* event) OVERRIDE { 93 virtual void OnScrollEvent(ScrollEvent* event) OVERRIDE {
94 ReceivedEvent(event); 94 ReceivedEvent(event);
95 SetStatusOnEvent(event); 95 SetStatusOnEvent(event);
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 h3->set_expect_pre_target(false); 466 h3->set_expect_pre_target(false);
467 467
468 MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4), 0); 468 MouseEvent mouse(ui::ET_MOUSE_MOVED, gfx::Point(3, 4), gfx::Point(3, 4), 0);
469 dispatcher->ProcessEvent(&target, &mouse); 469 dispatcher->ProcessEvent(&target, &mouse);
470 EXPECT_TRUE(mouse.stopped_propagation()); 470 EXPECT_TRUE(mouse.stopped_propagation());
471 EXPECT_EQ(2U, target.handler_list().size()); 471 EXPECT_EQ(2U, target.handler_list().size());
472 EXPECT_EQ(1, target.handler_list()[0]); 472 EXPECT_EQ(1, target.handler_list()[0]);
473 EXPECT_EQ(2, target.handler_list()[1]); 473 EXPECT_EQ(2, target.handler_list()[1]);
474 } 474 }
475 } // namespace ui 475 } // namespace ui
OLDNEW
« no previous file with comments | « ui/aura/test/test_window_delegate.cc ('k') | ui/base/events/event_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698