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

Unified Diff: ui/aura/window_event_dispatcher_unittest.cc

Issue 157003005: Replace std::map with base::SmallMap in ui::LatencyInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ui/events/latency_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_event_dispatcher_unittest.cc
diff --git a/ui/aura/window_event_dispatcher_unittest.cc b/ui/aura/window_event_dispatcher_unittest.cc
index b2cffaf6cd6a2001f294e8fe1a581dc10d8c25d6..ef6ecda0800508fc2981861ab4b848554ca9a037 100644
--- a/ui/aura/window_event_dispatcher_unittest.cc
+++ b/ui/aura/window_event_dispatcher_unittest.cc
@@ -1622,14 +1622,17 @@ class WindowEventDispatcherTestWithMessageLoop
// Start a nested message-loop, post an event to be dispatched, and then
// terminate the message-loop. When the message-loop unwinds and gets back,
// the reposted event should not have fired.
- ui::MouseEvent mouse(ui::ET_MOUSE_PRESSED, gfx::Point(10, 10),
- gfx::Point(10, 10), ui::EF_NONE, ui::EF_NONE);
- message_loop()->PostTask(FROM_HERE,
- base::Bind(&WindowEventDispatcher::RepostEvent,
- base::Unretained(host()->dispatcher()),
- mouse));
- message_loop()->PostTask(FROM_HERE,
- message_loop()->QuitClosure());
+ scoped_ptr<ui::MouseEvent> mouse(new ui::MouseEvent(ui::ET_MOUSE_PRESSED,
+ gfx::Point(10, 10),
+ gfx::Point(10, 10),
+ ui::EF_NONE,
+ ui::EF_NONE));
+ message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&WindowEventDispatcherTestWithMessageLoop::RepostEventHelper,
+ host()->dispatcher(),
+ base::Passed(&mouse)));
+ message_loop()->PostTask(FROM_HERE, message_loop()->QuitClosure());
base::MessageLoop::ScopedNestableTaskAllower allow(message_loop());
base::RunLoop loop;
@@ -1657,6 +1660,12 @@ class WindowEventDispatcherTestWithMessageLoop
}
private:
+ // Used to avoid a copying |event| when binding to a closure.
+ static void RepostEventHelper(WindowEventDispatcher* dispatcher,
+ scoped_ptr<ui::MouseEvent> event) {
+ dispatcher->RepostEvent(*event);
+ }
+
scoped_ptr<Window> window_;
ExitMessageLoopOnMousePress handler_;
« no previous file with comments | « ipc/ipc_message_utils.h ('k') | ui/events/latency_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698