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

Side by Side Diff: ui/views/test/views_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 | « ui/views/focus/focus_manager_unittest_win.cc ('k') | no next file » | 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/test/views_test_base.h" 5 #include "ui/views/test/views_test_base.h"
6 6
7 #include "base/run_loop.h"
8
7 #if defined(USE_AURA) 9 #if defined(USE_AURA)
8 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
9 #include "ui/aura/test/aura_test_helper.h" 11 #include "ui/aura/test/aura_test_helper.h"
10 #endif 12 #endif
11 13
12 namespace views { 14 namespace views {
13 15
14 ViewsTestBase::ViewsTestBase() 16 ViewsTestBase::ViewsTestBase()
15 : setup_called_(false), 17 : setup_called_(false),
16 teardown_called_(false) { 18 teardown_called_(false) {
(...skipping 23 matching lines...) Expand all
40 RunPendingMessages(); 42 RunPendingMessages();
41 teardown_called_ = true; 43 teardown_called_ = true;
42 views_delegate_.reset(); 44 views_delegate_.reset();
43 testing::Test::TearDown(); 45 testing::Test::TearDown();
44 #if defined(USE_AURA) 46 #if defined(USE_AURA)
45 aura_test_helper_->TearDown(); 47 aura_test_helper_->TearDown();
46 #endif 48 #endif
47 } 49 }
48 50
49 void ViewsTestBase::RunPendingMessages() { 51 void ViewsTestBase::RunPendingMessages() {
52 base::RunLoop run_loop;
50 #if defined(USE_AURA) 53 #if defined(USE_AURA)
51 message_loop_.RunAllPendingWithDispatcher( 54 run_loop.set_dispatcher(aura::Env::GetInstance()->GetDispatcher());
52 aura::Env::GetInstance()->GetDispatcher());
53 #else
54 message_loop_.RunAllPending();
55 #endif 55 #endif
56 run_loop.RunUntilIdle();
56 } 57 }
57 58
58 } // namespace views 59 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/focus/focus_manager_unittest_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698