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

Side by Side Diff: ui/events/event_rewriter_unittest.cc

Issue 1287103004: Sync ui/events to chromium @ https://codereview.chromium.org/1210203002 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 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
« no previous file with comments | « ui/events/event_processor_unittest.cc ('k') | ui/events/event_source.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/events/event_rewriter.h" 5 #include "ui/events/event_rewriter.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // removal, and sequencing. Consequently EVENT_REWRITE_DISPATCH_ANOTHER is not 77 // removal, and sequencing. Consequently EVENT_REWRITE_DISPATCH_ANOTHER is not
78 // supported here (calls to NextDispatchEvent() would continue indefinitely). 78 // supported here (calls to NextDispatchEvent() would continue indefinitely).
79 class TestConstantEventRewriter : public EventRewriter { 79 class TestConstantEventRewriter : public EventRewriter {
80 public: 80 public:
81 TestConstantEventRewriter(EventRewriteStatus status, EventType type) 81 TestConstantEventRewriter(EventRewriteStatus status, EventType type)
82 : status_(status), type_(type) { 82 : status_(status), type_(type) {
83 CHECK_NE(EVENT_REWRITE_DISPATCH_ANOTHER, status); 83 CHECK_NE(EVENT_REWRITE_DISPATCH_ANOTHER, status);
84 } 84 }
85 85
86 EventRewriteStatus RewriteEvent(const Event& event, 86 EventRewriteStatus RewriteEvent(const Event& event,
87 scoped_ptr<Event>* rewritten_event) 87 scoped_ptr<Event>* rewritten_event) override {
88 override {
89 if (status_ == EVENT_REWRITE_REWRITTEN) 88 if (status_ == EVENT_REWRITE_REWRITTEN)
90 rewritten_event->reset(new TestEvent(type_)); 89 rewritten_event->reset(new TestEvent(type_));
91 return status_; 90 return status_;
92 } 91 }
93 EventRewriteStatus NextDispatchEvent(const Event& last_event, 92 EventRewriteStatus NextDispatchEvent(const Event& last_event,
94 scoped_ptr<Event>* new_event) override { 93 scoped_ptr<Event>* new_event) override {
95 NOTREACHED(); 94 NOTREACHED();
96 return status_; 95 return status_;
97 } 96 }
98 97
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 s.RemoveEventRewriter(&r3); 218 s.RemoveEventRewriter(&r3);
220 219
221 // Continue with the state-based rewriting. 220 // Continue with the state-based rewriting.
222 p.AddExpectedEvent(ET_MOUSE_RELEASED); 221 p.AddExpectedEvent(ET_MOUSE_RELEASED);
223 p.AddExpectedEvent(ET_KEY_RELEASED); 222 p.AddExpectedEvent(ET_KEY_RELEASED);
224 s.Send(ET_MOUSE_RELEASED); 223 s.Send(ET_MOUSE_RELEASED);
225 p.CheckAllReceived(); 224 p.CheckAllReceived();
226 } 225 }
227 226
228 } // namespace ui 227 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event_processor_unittest.cc ('k') | ui/events/event_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698