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

Side by Side Diff: ui/events/ozone/evdev/event_converter_evdev_impl_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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/memory/scoped_vector.h" 7 #include "base/memory/scoped_vector.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 void ClearDispatchedEvents() { 135 void ClearDispatchedEvents() {
136 dispatched_events_.clear(); 136 dispatched_events_.clear();
137 } 137 }
138 138
139 void DestroyDevice() { device_.reset(); } 139 void DestroyDevice() { device_.reset(); }
140 140
141 private: 141 private:
142 void DispatchEventForTest(ui::Event* event) { 142 void DispatchEventForTest(ui::Event* event) {
143 scoped_ptr<ui::Event> cloned_event = ui::Event::Clone(*event); 143 scoped_ptr<ui::Event> cloned_event = ui::Event::Clone(*event);
144 dispatched_events_.push_back(cloned_event.release()); 144 dispatched_events_.push_back(cloned_event.Pass());
145 } 145 }
146 146
147 base::MessageLoopForUI ui_loop_; 147 base::MessageLoopForUI ui_loop_;
148 148
149 scoped_ptr<ui::MockCursorEvdev> cursor_; 149 scoped_ptr<ui::MockCursorEvdev> cursor_;
150 scoped_ptr<ui::DeviceManager> device_manager_; 150 scoped_ptr<ui::DeviceManager> device_manager_;
151 scoped_ptr<ui::EventFactoryEvdev> event_factory_; 151 scoped_ptr<ui::EventFactoryEvdev> event_factory_;
152 scoped_ptr<ui::DeviceEventDispatcherEvdev> dispatcher_; 152 scoped_ptr<ui::DeviceEventDispatcherEvdev> dispatcher_;
153 scoped_ptr<ui::MockEventConverterEvdevImpl> device_; 153 scoped_ptr<ui::MockEventConverterEvdevImpl> device_;
154 154
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 dev->SetAllowedKeys(allowed_keys.Pass()); 632 dev->SetAllowedKeys(allowed_keys.Pass());
633 ASSERT_EQ(1u, size()); 633 ASSERT_EQ(1u, size());
634 event = dispatched_event(0); 634 event = dispatched_event(0);
635 EXPECT_EQ(ui::ET_KEY_RELEASED, event->type()); 635 EXPECT_EQ(ui::ET_KEY_RELEASED, event->type());
636 636
637 // The real key release should be dropped, whenever it comes. 637 // The real key release should be dropped, whenever it comes.
638 ClearDispatchedEvents(); 638 ClearDispatchedEvents();
639 dev->ProcessEvents(key_release, arraysize(key_release)); 639 dev->ProcessEvents(key_release, arraysize(key_release));
640 ASSERT_EQ(0u, size()); 640 ASSERT_EQ(0u, size());
641 } 641 }
OLDNEW
« no previous file with comments | « ui/events/gestures/gesture_provider_aura.cc ('k') | ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698