| 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. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 namespace aura { | 27 namespace aura { |
| 28 namespace test { | 28 namespace test { |
| 29 class AuraTestHelper; | 29 class AuraTestHelper; |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace gfx { | 33 namespace gfx { |
| 34 class Size; | 34 class Size; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace views { | 37 namespace wm { |
| 38 namespace corewm { | |
| 39 class WMState; | 38 class WMState; |
| 40 } | 39 } |
| 41 } | |
| 42 | 40 |
| 43 // Base class for Views based tests that dispatch events. | 41 // Base class for Views based tests that dispatch events. |
| 44 // | 42 // |
| 45 // As views based event test involves waiting for events to be processed, | 43 // As views based event test involves waiting for events to be processed, |
| 46 // writing a views based test is slightly different than that of writing | 44 // writing a views based test is slightly different than that of writing |
| 47 // other unit tests. In particular when the test fails or is done you need | 45 // other unit tests. In particular when the test fails or is done you need |
| 48 // to stop the message loop. This can be done by way of invoking the Done | 46 // to stop the message loop. This can be done by way of invoking the Done |
| 49 // method. | 47 // method. |
| 50 // | 48 // |
| 51 // Any delayed callbacks should be done by way of CreateEventTask. | 49 // Any delayed callbacks should be done by way of CreateEventTask. |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 scoped_ptr<base::Thread> dnd_thread_; | 147 scoped_ptr<base::Thread> dnd_thread_; |
| 150 | 148 |
| 151 content::TestBrowserThreadBundle thread_bundle_; | 149 content::TestBrowserThreadBundle thread_bundle_; |
| 152 | 150 |
| 153 #if defined(OS_WIN) | 151 #if defined(OS_WIN) |
| 154 ui::ScopedOleInitializer ole_initializer_; | 152 ui::ScopedOleInitializer ole_initializer_; |
| 155 #endif | 153 #endif |
| 156 | 154 |
| 157 #if defined(USE_AURA) | 155 #if defined(USE_AURA) |
| 158 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 156 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
| 159 scoped_ptr<views::corewm::WMState> wm_state_; | 157 scoped_ptr<wm::WMState> wm_state_; |
| 160 #endif | 158 #endif |
| 161 | 159 |
| 162 ChromeViewsDelegate views_delegate_; | 160 ChromeViewsDelegate views_delegate_; |
| 163 | 161 |
| 164 DISALLOW_COPY_AND_ASSIGN(ViewEventTestBase); | 162 DISALLOW_COPY_AND_ASSIGN(ViewEventTestBase); |
| 165 }; | 163 }; |
| 166 | 164 |
| 167 // Convenience macro for defining a ViewEventTestBase. See class description | 165 // Convenience macro for defining a ViewEventTestBase. See class description |
| 168 // of ViewEventTestBase for details. | 166 // of ViewEventTestBase for details. |
| 169 #define VIEW_TEST(test_class, name) \ | 167 #define VIEW_TEST(test_class, name) \ |
| 170 TEST_F(test_class, name) {\ | 168 TEST_F(test_class, name) {\ |
| 171 StartMessageLoopAndRunTest();\ | 169 StartMessageLoopAndRunTest();\ |
| 172 } | 170 } |
| 173 | 171 |
| 174 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) | 172 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) |
| 175 | 173 |
| 176 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ | 174 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ |
| OLD | NEW |