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

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

Issue 1138993007: Substituting pattern push_back(ptr.release()) with push_back(ptr.Pass()) in ui/events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated the review comments Created 5 years, 7 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 <errno.h> 5 #include <errno.h>
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <linux/input.h> 7 #include <linux/input.h>
8 #include <unistd.h> 8 #include <unistd.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 unsigned size() { return dispatched_events_.size(); } 212 unsigned size() { return dispatched_events_.size(); }
213 ui::MouseEvent* dispatched_event(unsigned index) { 213 ui::MouseEvent* dispatched_event(unsigned index) {
214 DCHECK_GT(dispatched_events_.size(), index); 214 DCHECK_GT(dispatched_events_.size(), index);
215 ui::Event* ev = dispatched_events_[index]; 215 ui::Event* ev = dispatched_events_[index];
216 DCHECK(ev->IsMouseEvent()); 216 DCHECK(ev->IsMouseEvent());
217 return static_cast<ui::MouseEvent*>(ev); 217 return static_cast<ui::MouseEvent*>(ev);
218 } 218 }
219 219
220 void DispatchEventForTest(ui::Event* event) { 220 void DispatchEventForTest(ui::Event* event) {
221 scoped_ptr<ui::Event> cloned_event = ui::Event::Clone(*event); 221 scoped_ptr<ui::Event> cloned_event = ui::Event::Clone(*event);
222 dispatched_events_.push_back(cloned_event.release()); 222 dispatched_events_.push_back(cloned_event.Pass());
223 } 223 }
224 224
225 private: 225 private:
226 scoped_ptr<ui::MockTabletCursorEvdev> cursor_; 226 scoped_ptr<ui::MockTabletCursorEvdev> cursor_;
227 scoped_ptr<ui::DeviceManager> device_manager_; 227 scoped_ptr<ui::DeviceManager> device_manager_;
228 scoped_ptr<ui::EventFactoryEvdev> event_factory_; 228 scoped_ptr<ui::EventFactoryEvdev> event_factory_;
229 scoped_ptr<ui::DeviceEventDispatcherEvdev> dispatcher_; 229 scoped_ptr<ui::DeviceEventDispatcherEvdev> dispatcher_;
230 230
231 ScopedVector<ui::Event> dispatched_events_; 231 ScopedVector<ui::Event> dispatched_events_;
232 232
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 489
490 struct input_event mock_kernel_queue[] = { 490 struct input_event mock_kernel_queue[] = {
491 {{0, 0}, EV_ABS, ABS_X, 0}, 491 {{0, 0}, EV_ABS, ABS_X, 0},
492 {{0, 0}, EV_ABS, ABS_Y, 0}, 492 {{0, 0}, EV_ABS, ABS_Y, 0},
493 {{0, 0}, EV_SYN, SYN_REPORT, 0}, 493 {{0, 0}, EV_SYN, SYN_REPORT, 0},
494 }; 494 };
495 495
496 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue)); 496 dev->ProcessEvents(mock_kernel_queue, arraysize(mock_kernel_queue));
497 EXPECT_EQ(0u, size()); 497 EXPECT_EQ(0u, size());
498 } 498 }
OLDNEW
« no previous file with comments | « ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc ('k') | ui/events/platform/platform_event_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698