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

Side by Side Diff: ui/aura/window_targeter_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 unified diff | Download patch
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | ui/aura/window_tree_host_platform.cc » ('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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/aura/window_targeter.h" 5 #include "ui/aura/window_targeter.h"
6 6
7 #include <utility>
8
7 #include "ui/aura/scoped_window_targeter.h" 9 #include "ui/aura/scoped_window_targeter.h"
8 #include "ui/aura/test/aura_test_base.h" 10 #include "ui/aura/test/aura_test_base.h"
9 #include "ui/aura/test/test_window_delegate.h" 11 #include "ui/aura/test/test_window_delegate.h"
10 #include "ui/aura/window.h" 12 #include "ui/aura/window.h"
11 #include "ui/events/event_utils.h" 13 #include "ui/events/event_utils.h"
12 #include "ui/events/test/test_event_handler.h" 14 #include "ui/events/test/test_event_handler.h"
13 15
14 namespace aura { 16 namespace aura {
15 17
16 // Always returns the same window. 18 // Always returns the same window.
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 // Now install a targeter on the |child| that looks at the window id as well 235 // Now install a targeter on the |child| that looks at the window id as well
234 // as the bounds and makes sure the event reaches the target only if the id of 236 // as the bounds and makes sure the event reaches the target only if the id of
235 // the window is equal to 1 (correct). 237 // the window is equal to 1 (correct).
236 ui::MouseEvent mouse3(ui::ET_MOUSE_MOVED, gfx::Point(8, 8), gfx::Point(8, 8), 238 ui::MouseEvent mouse3(ui::ET_MOUSE_MOVED, gfx::Point(8, 8), gfx::Point(8, 8),
237 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); 239 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
238 child_r->SetEventTargeter( 240 child_r->SetEventTargeter(
239 scoped_ptr<ui::EventTargeter>(new IdCheckingEventTargeter(1))); 241 scoped_ptr<ui::EventTargeter>(new IdCheckingEventTargeter(1)));
240 EXPECT_EQ(child_r, targeter->FindTargetForEvent(root_target, &mouse3)); 242 EXPECT_EQ(child_r, targeter->FindTargetForEvent(root_target, &mouse3));
241 243
242 // restore original WindowTargeter for |child|. 244 // restore original WindowTargeter for |child|.
243 child_r->SetEventTargeter(original_targeter.Pass()); 245 child_r->SetEventTargeter(std::move(original_targeter));
244 246
245 // Target |grandchild| location. 247 // Target |grandchild| location.
246 ui::MouseEvent second(ui::ET_MOUSE_MOVED, gfx::Point(12, 12), 248 ui::MouseEvent second(ui::ET_MOUSE_MOVED, gfx::Point(12, 12),
247 gfx::Point(12, 12), ui::EventTimeForNow(), ui::EF_NONE, 249 gfx::Point(12, 12), ui::EventTimeForNow(), ui::EF_NONE,
248 ui::EF_NONE); 250 ui::EF_NONE);
249 EXPECT_EQ(grandchild_r, targeter->FindTargetForEvent(root_target, &second)); 251 EXPECT_EQ(grandchild_r, targeter->FindTargetForEvent(root_target, &second));
250 252
251 // Target |child| location. 253 // Target |child| location.
252 ui::MouseEvent third(ui::ET_MOUSE_MOVED, gfx::Point(8, 8), gfx::Point(8, 8), 254 ui::MouseEvent third(ui::ET_MOUSE_MOVED, gfx::Point(8, 8), gfx::Point(8, 8),
253 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE); 255 ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 child->SetEventTargeter( 288 child->SetEventTargeter(
287 scoped_ptr<ui::EventTargeter>(new IgnoreWindowTargeter())); 289 scoped_ptr<ui::EventTargeter>(new IgnoreWindowTargeter()));
288 290
289 ui::MouseEvent mouse2(ui::ET_MOUSE_MOVED, gfx::Point(10, 10), 291 ui::MouseEvent mouse2(ui::ET_MOUSE_MOVED, gfx::Point(10, 10),
290 gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE, 292 gfx::Point(10, 10), ui::EventTimeForNow(), ui::EF_NONE,
291 ui::EF_NONE); 293 ui::EF_NONE);
292 EXPECT_EQ(root_window(), targeter->FindTargetForEvent(root_target, &mouse2)); 294 EXPECT_EQ(root_window(), targeter->FindTargetForEvent(root_target, &mouse2));
293 } 295 }
294 296
295 } // namespace aura 297 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | ui/aura/window_tree_host_platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698