OLD | NEW |
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/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 |
11 #include "ui/aura/root_window.h" | 11 #include "ui/aura/root_window.h" |
| 12 #include "ui/gfx/compositor/layer_animator.h" |
12 | 13 |
13 namespace aura { | 14 namespace aura { |
14 namespace test { | 15 namespace test { |
15 | 16 |
16 AuraTestBase::AuraTestBase() | 17 AuraTestBase::AuraTestBase() |
17 : setup_called_(false), | 18 : setup_called_(false), |
18 teardown_called_(false) { | 19 teardown_called_(false) { |
19 #if defined(OS_WIN) | 20 #if defined(OS_WIN) |
20 OleInitialize(NULL); | 21 OleInitialize(NULL); |
21 #endif | 22 #endif |
22 | 23 |
23 RootWindow::GetInstance()->Show(); | 24 RootWindow::GetInstance()->Show(); |
24 RootWindow::GetInstance()->SetHostSize(gfx::Size(600, 600)); | 25 RootWindow::GetInstance()->SetHostSize(gfx::Size(600, 600)); |
| 26 |
| 27 // Disable animations during tests. |
| 28 ui::LayerAnimator::set_disable_animations_for_test(true); |
25 } | 29 } |
26 | 30 |
27 AuraTestBase::~AuraTestBase() { | 31 AuraTestBase::~AuraTestBase() { |
28 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
29 OleUninitialize(); | 33 OleUninitialize(); |
30 #endif | 34 #endif |
31 CHECK(setup_called_) | 35 CHECK(setup_called_) |
32 << "You have overridden SetUp but never called super class's SetUp"; | 36 << "You have overridden SetUp but never called super class's SetUp"; |
33 CHECK(teardown_called_) | 37 CHECK(teardown_called_) |
34 << "You have overridden TearDown but never called super class's TearDown"; | 38 << "You have overridden TearDown but never called super class's TearDown"; |
(...skipping 19 matching lines...) Expand all Loading... |
54 | 58 |
55 void AuraTestBase::RunAllPendingInMessageLoop() { | 59 void AuraTestBase::RunAllPendingInMessageLoop() { |
56 #if !defined(OS_MACOSX) | 60 #if !defined(OS_MACOSX) |
57 message_loop_.RunAllPendingWithDispatcher( | 61 message_loop_.RunAllPendingWithDispatcher( |
58 RootWindow::GetInstance()->GetDispatcher()); | 62 RootWindow::GetInstance()->GetDispatcher()); |
59 #endif | 63 #endif |
60 } | 64 } |
61 | 65 |
62 } // namespace test | 66 } // namespace test |
63 } // namespace aura | 67 } // namespace aura |
OLD | NEW |