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

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc

Issue 858333006: [PATCH 9.6/11] ozone: evdev: Remove extra PostTask during dispatch from EventFactoryEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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 <linux/input.h> 5 #include <linux/input.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 return static_cast<ui::KeyEvent*>(ev); 121 return static_cast<ui::KeyEvent*>(ev);
122 } 122 }
123 ui::MouseEvent* dispatched_mouse_event(unsigned index) { 123 ui::MouseEvent* dispatched_mouse_event(unsigned index) {
124 DCHECK_GT(dispatched_events_.size(), index); 124 DCHECK_GT(dispatched_events_.size(), index);
125 ui::Event* ev = dispatched_events_[index]; 125 ui::Event* ev = dispatched_events_[index];
126 DCHECK(ev->IsMouseEvent()); 126 DCHECK(ev->IsMouseEvent());
127 return static_cast<ui::MouseEvent*>(ev); 127 return static_cast<ui::MouseEvent*>(ev);
128 } 128 }
129 129
130 private: 130 private:
131 void DispatchEventForTest(scoped_ptr<ui::Event> event) { 131 void DispatchEventForTest(ui::Event* event) {
132 dispatched_events_.push_back(event.release()); 132 scoped_ptr<ui::Event> cloned_event = ui::Event::Clone(*event);
133 dispatched_events_.push_back(cloned_event.release());
133 } 134 }
134 135
135 base::MessageLoopForUI ui_loop_; 136 base::MessageLoopForUI ui_loop_;
136 137
137 scoped_ptr<ui::MockCursorEvdev> cursor_; 138 scoped_ptr<ui::MockCursorEvdev> cursor_;
138 scoped_ptr<ui::DeviceManager> device_manager_; 139 scoped_ptr<ui::DeviceManager> device_manager_;
139 scoped_ptr<ui::EventFactoryEvdev> event_factory_; 140 scoped_ptr<ui::EventFactoryEvdev> event_factory_;
140 scoped_ptr<ui::DeviceEventDispatcherEvdev> dispatcher_; 141 scoped_ptr<ui::DeviceEventDispatcherEvdev> dispatcher_;
141 scoped_ptr<ui::MockEventConverterEvdevImpl> device_; 142 scoped_ptr<ui::MockEventConverterEvdevImpl> device_;
142 143
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 {{0, 0}, EV_KEY, BTN_TOUCH, 1}, 449 {{0, 0}, EV_KEY, BTN_TOUCH, 1},
449 {{0, 0}, EV_SYN, SYN_REPORT, 0}, 450 {{0, 0}, EV_SYN, SYN_REPORT, 0},
450 451
451 {{0, 0}, EV_KEY, BTN_TOUCH, 0}, 452 {{0, 0}, EV_KEY, BTN_TOUCH, 0},
452 {{0, 0}, EV_SYN, SYN_REPORT, 0}, 453 {{0, 0}, EV_SYN, SYN_REPORT, 0},
453 }; 454 };
454 455
455 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue)); 456 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue));
456 EXPECT_EQ(0u, size()); 457 EXPECT_EQ(0u, size());
457 } 458 }
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/evdev/event_converter_test_util.cc » ('j') | ui/events/ozone/evdev/event_factory_evdev.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698