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

Side by Side Diff: ui/views/examples/content_client/examples_browser_main_parts.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 | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/focus/focus_manager_unittest_win.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) 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/views/examples/content_client/examples_browser_main_parts.h" 5 #include "ui/views/examples/content_client/examples_browser_main_parts.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/run_loop.h"
10 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
11 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
12 #include "base/threading/thread_restrictions.h" 13 #include "base/threading/thread_restrictions.h"
13 #include "content/public/common/content_switches.h" 14 #include "content/public/common/content_switches.h"
14 #include "content/shell/shell_browser_context.h" 15 #include "content/shell/shell_browser_context.h"
15 #include "googleurl/src/gurl.h" 16 #include "googleurl/src/gurl.h"
16 #include "net/base/net_module.h" 17 #include "net/base/net_module.h"
17 #include "ui/views/examples/examples_window.h" 18 #include "ui/views/examples/examples_window.h"
18 #include "ui/views/focus/accelerator_handler.h" 19 #include "ui/views/focus/accelerator_handler.h"
19 #include "ui/views/test/test_views_delegate.h" 20 #include "ui/views/test/test_views_delegate.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 #if defined(USE_AURA) 71 #if defined(USE_AURA)
71 stacking_client_.reset(); 72 stacking_client_.reset();
72 aura::Env::DeleteInstance(); 73 aura::Env::DeleteInstance();
73 #endif 74 #endif
74 } 75 }
75 76
76 bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) { 77 bool ExamplesBrowserMainParts::MainMessageLoopRun(int* result_code) {
77 // xxx: Hax here because this kills event handling. 78 // xxx: Hax here because this kills event handling.
78 #if !defined(USE_AURA) 79 #if !defined(USE_AURA)
79 views::AcceleratorHandler accelerator_handler; 80 views::AcceleratorHandler accelerator_handler;
80 MessageLoopForUI::current()->RunWithDispatcher(&accelerator_handler); 81 base::RunLoop run_loop(&accelerator_handler);
81 #else 82 #else
82 MessageLoopForUI::current()->Run(); 83 base::RunLoop run_loop;
83 #endif 84 #endif
85 run_loop.Run();
84 return true; 86 return true;
85 } 87 }
86 88
87 } // namespace examples 89 } // namespace examples
88 } // namespace views 90 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller.cc ('k') | ui/views/focus/focus_manager_unittest_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698