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

Unified Diff: ui/events/scoped_target_handler_unittest.cc

Issue 1539583003: Convert Pass()→std::move() in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/platform/platform_event_source_unittest.cc ('k') | ui/events/test/event_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/scoped_target_handler_unittest.cc
diff --git a/ui/events/scoped_target_handler_unittest.cc b/ui/events/scoped_target_handler_unittest.cc
index b8c8d7811f2a381d93a872dbb1b93e9e867ec9fd..6a6c6533e17e68e7b256c69824724ff600135d66 100644
--- a/ui/events/scoped_target_handler_unittest.cc
+++ b/ui/events/scoped_target_handler_unittest.cc
@@ -4,6 +4,8 @@
#include "ui/events/scoped_target_handler.h"
+#include <utility>
+
#include "base/memory/scoped_ptr.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/event_handler.h"
@@ -34,8 +36,8 @@ class TestEventTarget : public EventTarget {
void SetHandler(scoped_ptr<EventHandler> target_handler,
scoped_ptr<EventHandler> delegate) {
- target_handler_ = target_handler.Pass();
- delegate_ = delegate.Pass();
+ target_handler_ = std::move(target_handler);
+ delegate_ = std::move(delegate);
}
// EventTarget:
@@ -142,7 +144,7 @@ TEST(ScopedTargetHandlerTest, HandlerInvoked) {
new NestedEventHandler(target, 1));
scoped_ptr<EventCountingEventHandler> delegate(
new EventCountingEventHandler(target, &count));
- target->SetHandler(target_handler.Pass(), delegate.Pass());
+ target->SetHandler(std::move(target_handler), std::move(delegate));
MouseEvent event(ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
EventTimeForNow(), EF_LEFT_MOUSE_BUTTON,
EF_LEFT_MOUSE_BUTTON);
@@ -160,7 +162,7 @@ TEST(ScopedTargetHandlerTest, HandlerInvokedNested) {
new NestedEventHandler(target, 2));
scoped_ptr<EventCountingEventHandler> delegate(
new EventCountingEventHandler(target, &count));
- target->SetHandler(target_handler.Pass(), delegate.Pass());
+ target->SetHandler(std::move(target_handler), std::move(delegate));
MouseEvent event(ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
EventTimeForNow(), EF_LEFT_MOUSE_BUTTON,
EF_LEFT_MOUSE_BUTTON);
@@ -178,7 +180,7 @@ TEST(ScopedTargetHandlerTest, SafeToDestroy) {
new TargetDestroyingEventHandler(target, 1));
scoped_ptr<EventCountingEventHandler> delegate(
new EventCountingEventHandler(target, &count));
- target->SetHandler(target_handler.Pass(), delegate.Pass());
+ target->SetHandler(std::move(target_handler), std::move(delegate));
MouseEvent event(ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
EventTimeForNow(), EF_LEFT_MOUSE_BUTTON,
EF_LEFT_MOUSE_BUTTON);
@@ -195,7 +197,7 @@ TEST(ScopedTargetHandlerTest, SafeToDestroyNested) {
new TargetDestroyingEventHandler(target, 2));
scoped_ptr<EventCountingEventHandler> delegate(
new EventCountingEventHandler(target, &count));
- target->SetHandler(target_handler.Pass(), delegate.Pass());
+ target->SetHandler(std::move(target_handler), std::move(delegate));
MouseEvent event(ET_MOUSE_PRESSED, gfx::Point(), gfx::Point(),
EventTimeForNow(), EF_LEFT_MOUSE_BUTTON,
EF_LEFT_MOUSE_BUTTON);
« no previous file with comments | « ui/events/platform/platform_event_source_unittest.cc ('k') | ui/events/test/event_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698