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

Side by Side Diff: ui/aura/test/aura_test_base.cc

Issue 8387043: [Aura] Support always-on-top top level window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and update comment per ben Created 9 years, 1 month 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/aura/test/aura_test_base.h ('k') | ui/aura_shell/always_on_top_controller.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/test/aura_test_base.h" 5 #include "ui/aura/test/aura_test_base.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <ole2.h> 8 #include <ole2.h>
9 #endif 9 #endif
10 10
(...skipping 20 matching lines...) Expand all
31 #if defined(OS_WIN) 31 #if defined(OS_WIN)
32 OleUninitialize(); 32 OleUninitialize();
33 #endif 33 #endif
34 CHECK(setup_called_) 34 CHECK(setup_called_)
35 << "You have overridden SetUp but never called super class's SetUp"; 35 << "You have overridden SetUp but never called super class's SetUp";
36 CHECK(teardown_called_) 36 CHECK(teardown_called_)
37 << "You have overridden TearDown but never called super class's TearDown"; 37 << "You have overridden TearDown but never called super class's TearDown";
38 38
39 // Flush the message loop because we have pending release tasks 39 // Flush the message loop because we have pending release tasks
40 // and these tasks if un-executed would upset Valgrind. 40 // and these tasks if un-executed would upset Valgrind.
41 message_loop_.RunAllPendingWithDispatcher( 41 RunAllPendingInMessageLoop();
42 Desktop::GetInstance()->GetDispatcher());
43 42
44 // Ensure that we don't use the previously-allocated static Desktop object 43 // Ensure that we don't use the previously-allocated static Desktop object
45 // later -- on Linux, it holds a reference to our message loop's X connection. 44 // later -- on Linux, it holds a reference to our message loop's X connection.
46 aura::Desktop::DeleteInstanceForTesting(); 45 aura::Desktop::DeleteInstanceForTesting();
47 } 46 }
48 47
49 TestStackingClient* AuraTestBase::GetTestStackingClient() { 48 TestStackingClient* AuraTestBase::GetTestStackingClient() {
50 return static_cast<TestStackingClient*>( 49 return static_cast<TestStackingClient*>(
51 aura::Desktop::GetInstance()->stacking_client()); 50 aura::Desktop::GetInstance()->stacking_client());
52 } 51 }
53 52
54 void AuraTestBase::SetUp() { 53 void AuraTestBase::SetUp() {
55 testing::Test::SetUp(); 54 testing::Test::SetUp();
56 setup_called_ = true; 55 setup_called_ = true;
57 } 56 }
58 57
59 void AuraTestBase::TearDown() { 58 void AuraTestBase::TearDown() {
60 teardown_called_ = true; 59 teardown_called_ = true;
61 testing::Test::TearDown(); 60 testing::Test::TearDown();
62 } 61 }
63 62
63 void AuraTestBase::RunAllPendingInMessageLoop() {
64 message_loop_.RunAllPendingWithDispatcher(
65 Desktop::GetInstance()->GetDispatcher());
66 }
67
64 } // namespace test 68 } // namespace test
65 } // namespace aura 69 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/test/aura_test_base.h ('k') | ui/aura_shell/always_on_top_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698