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

Side by Side Diff: ash/test/ash_test_base.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 | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/wm/toplevel_window_event_filter.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 "ash/test/ash_test_base.h" 5 #include "ash/test/ash_test_base.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/test/test_shell_delegate.h" 11 #include "ash/test/test_shell_delegate.h"
12 #include "base/run_loop.h"
12 #include "base/string_split.h" 13 #include "base/string_split.h"
13 #include "content/public/test/web_contents_tester.h" 14 #include "content/public/test/web_contents_tester.h"
14 #include "ui/aura/env.h" 15 #include "ui/aura/env.h"
15 #include "ui/aura/monitor_manager.h" 16 #include "ui/aura/monitor_manager.h"
16 #include "ui/aura/root_window.h" 17 #include "ui/aura/root_window.h"
17 #include "ui/base/ime/text_input_test_support.h" 18 #include "ui/base/ime/text_input_test_support.h"
18 #include "ui/compositor/layer_animator.h" 19 #include "ui/compositor/layer_animator.h"
19 #include "ui/gfx/display.h" 20 #include "ui/gfx/display.h"
20 #include "ui/gfx/screen.h" 21 #include "ui/gfx/screen.h"
21 22
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 } 84 }
84 85
85 void AshTestBase::UpdateMonitor(const std::string& display_specs) { 86 void AshTestBase::UpdateMonitor(const std::string& display_specs) {
86 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); 87 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs);
87 aura::Env::GetInstance()->monitor_manager()-> 88 aura::Env::GetInstance()->monitor_manager()->
88 OnNativeMonitorsChanged(displays); 89 OnNativeMonitorsChanged(displays);
89 } 90 }
90 91
91 void AshTestBase::RunAllPendingInMessageLoop() { 92 void AshTestBase::RunAllPendingInMessageLoop() {
92 #if !defined(OS_MACOSX) 93 #if !defined(OS_MACOSX)
93 message_loop_.RunAllPendingWithDispatcher( 94 DCHECK(MessageLoopForUI::current() == &message_loop_);
94 aura::Env::GetInstance()->GetDispatcher()); 95 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher());
96 run_loop.RunUntilIdle();
95 #endif 97 #endif
96 } 98 }
97 99
98 } // namespace test 100 } // namespace test
99 } // namespace ash 101 } // namespace ash
OLDNEW
« no previous file with comments | « ash/drag_drop/drag_drop_controller.cc ('k') | ash/wm/toplevel_window_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698