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 #ifndef CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ | 5 #ifndef CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ |
6 #define CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ | 6 #define CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ |
7 | 7 |
8 // We only want to use ViewEventTestBase in test targets which properly | 8 // We only want to use ViewEventTestBase in test targets which properly |
9 // isolate each test case by running each test in a separate process. | 9 // isolate each test case by running each test in a separate process. |
10 // This way if a test hangs the test launcher can reliably terminate it. | 10 // This way if a test hangs the test launcher can reliably terminate it. |
11 #if defined(HAS_OUT_OF_PROC_TEST_RUNNER) | 11 #if defined(HAS_OUT_OF_PROC_TEST_RUNNER) |
12 | 12 |
13 #include "base/bind.h" | 13 #include "base/bind.h" |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
17 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
18 #include "content/public/test/test_browser_thread_bundle.h" | 18 #include "content/public/test/test_browser_thread_bundle.h" |
19 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
20 #include "ui/views/widget/widget_delegate.h" | 20 #include "ui/views/widget/widget_delegate.h" |
21 | 21 |
22 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
23 #include "ui/base/win/scoped_ole_initializer.h" | 23 #include "ui/base/win/scoped_ole_initializer.h" |
24 #endif | 24 #endif |
25 | 25 |
| 26 namespace ash { |
| 27 namespace test { |
| 28 class AshTestHelper; |
| 29 } |
| 30 } |
| 31 |
26 namespace aura { | 32 namespace aura { |
27 namespace test { | 33 namespace test { |
28 class AuraTestHelper; | 34 class AuraTestHelper; |
29 } | 35 } |
30 } | 36 } |
31 | 37 |
32 namespace gfx { | 38 namespace gfx { |
33 class Size; | 39 class Size; |
34 } | 40 } |
35 | 41 |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 146 |
141 // Thread for posting background MouseMoves. | 147 // Thread for posting background MouseMoves. |
142 scoped_ptr<base::Thread> dnd_thread_; | 148 scoped_ptr<base::Thread> dnd_thread_; |
143 | 149 |
144 content::TestBrowserThreadBundle thread_bundle_; | 150 content::TestBrowserThreadBundle thread_bundle_; |
145 | 151 |
146 #if defined(OS_WIN) | 152 #if defined(OS_WIN) |
147 ui::ScopedOleInitializer ole_initializer_; | 153 ui::ScopedOleInitializer ole_initializer_; |
148 #endif | 154 #endif |
149 | 155 |
150 #if defined(USE_AURA) | 156 #if defined(USE_ASH) |
| 157 scoped_ptr<ash::test::AshTestHelper> ash_test_helper_; |
| 158 #elif defined(USE_AURA) |
151 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 159 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
152 #endif | 160 #endif |
153 | 161 |
154 DISALLOW_COPY_AND_ASSIGN(ViewEventTestBase); | 162 DISALLOW_COPY_AND_ASSIGN(ViewEventTestBase); |
155 }; | 163 }; |
156 | 164 |
157 // Convenience macro for defining a ViewEventTestBase. See class description | 165 // Convenience macro for defining a ViewEventTestBase. See class description |
158 // of ViewEventTestBase for details. | 166 // of ViewEventTestBase for details. |
159 #define VIEW_TEST(test_class, name) \ | 167 #define VIEW_TEST(test_class, name) \ |
160 TEST_F(test_class, name) {\ | 168 TEST_F(test_class, name) {\ |
161 StartMessageLoopAndRunTest();\ | 169 StartMessageLoopAndRunTest();\ |
162 } | 170 } |
163 | 171 |
164 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) | 172 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) |
165 | 173 |
166 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ | 174 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ |
OLD | NEW |