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

Side by Side Diff: ui/aura/desktop/desktop_dispatcher_client.cc

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: phajdan feedback Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « content/test/test_navigation_observer.cc ('k') | ui/aura/env.h » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/desktop/desktop_dispatcher_client.h" 5 #include "ui/aura/desktop/desktop_dispatcher_client.h"
6 6
7 #include "base/run_loop.h"
8
7 namespace aura { 9 namespace aura {
8 10
9 DesktopDispatcherClient::DesktopDispatcherClient() {} 11 DesktopDispatcherClient::DesktopDispatcherClient() {}
10 12
11 DesktopDispatcherClient::~DesktopDispatcherClient() {} 13 DesktopDispatcherClient::~DesktopDispatcherClient() {}
12 14
13 void DesktopDispatcherClient::RunWithDispatcher( 15 void DesktopDispatcherClient::RunWithDispatcher(
14 MessageLoop::Dispatcher* nested_dispatcher, 16 MessageLoop::Dispatcher* nested_dispatcher,
15 aura::Window* associated_window, 17 aura::Window* associated_window,
16 bool nestable_tasks_allowed) { 18 bool nestable_tasks_allowed) {
17 // TODO(erg): This class has been copypastad from 19 // TODO(erg): This class has been copypastad from
18 // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes 20 // ash/accelerators/nested_dispatcher_controller.cc. I have left my changes
19 // commented out because I don't entirely understand the implications of the 21 // commented out because I don't entirely understand the implications of the
20 // change. 22 // change.
21 MessageLoopForUI* loop = MessageLoopForUI::current(); 23 MessageLoopForUI* loop = MessageLoopForUI::current();
22 bool did_allow_task_nesting = loop->NestableTasksAllowed(); 24 bool did_allow_task_nesting = loop->NestableTasksAllowed();
23 loop->SetNestableTasksAllowed(nestable_tasks_allowed); 25 loop->SetNestableTasksAllowed(nestable_tasks_allowed);
24 26
25 // DefaultAcceleratorDispatcher dispatcher(nested_dispatcher, 27 // DefaultAcceleratorDispatcher dispatcher(nested_dispatcher,
26 // associated_window); 28 // associated_window);
27 loop->RunWithDispatcher(nested_dispatcher); 29 base::RunLoop run_loop(nested_dispatcher);
30 run_loop.Run();
28 loop->SetNestableTasksAllowed(did_allow_task_nesting); 31 loop->SetNestableTasksAllowed(did_allow_task_nesting);
29 } 32 }
30 33
31 } // namespace aura 34 } // namespace aura
32 35
OLDNEW
« no previous file with comments | « content/test/test_navigation_observer.cc ('k') | ui/aura/env.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698