| 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 "chrome/browser/ui/views/chrome_views_delegate.h" | |
| 19 #include "content/public/test/test_browser_thread_bundle.h" | 18 #include "content/public/test/test_browser_thread_bundle.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 19 #include "testing/gtest/include/gtest/gtest.h" |
| 20 #include "ui/views/test/test_views_delegate.h" |
| 21 #include "ui/views/widget/widget_delegate.h" | 21 #include "ui/views/widget/widget_delegate.h" |
| 22 | 22 |
| 23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 24 #include "ui/base/win/scoped_ole_initializer.h" | 24 #include "ui/base/win/scoped_ole_initializer.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace gfx { | 27 namespace gfx { |
| 28 class Size; | 28 class Size; |
| 29 } | 29 } |
| 30 | 30 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 scoped_ptr<base::Thread> dnd_thread_; | 141 scoped_ptr<base::Thread> dnd_thread_; |
| 142 | 142 |
| 143 content::TestBrowserThreadBundle thread_bundle_; | 143 content::TestBrowserThreadBundle thread_bundle_; |
| 144 | 144 |
| 145 #if defined(OS_WIN) | 145 #if defined(OS_WIN) |
| 146 ui::ScopedOleInitializer ole_initializer_; | 146 ui::ScopedOleInitializer ole_initializer_; |
| 147 #endif | 147 #endif |
| 148 | 148 |
| 149 scoped_ptr<ViewEventTestPlatformPart> platform_part_; | 149 scoped_ptr<ViewEventTestPlatformPart> platform_part_; |
| 150 | 150 |
| 151 ChromeViewsDelegate views_delegate_; | 151 views::TestViewsDelegate views_delegate_; |
| 152 | 152 |
| 153 DISALLOW_COPY_AND_ASSIGN(ViewEventTestBase); | 153 DISALLOW_COPY_AND_ASSIGN(ViewEventTestBase); |
| 154 }; | 154 }; |
| 155 | 155 |
| 156 // Convenience macro for defining a ViewEventTestBase. See class description | 156 // Convenience macro for defining a ViewEventTestBase. See class description |
| 157 // of ViewEventTestBase for details. | 157 // of ViewEventTestBase for details. |
| 158 #define VIEW_TEST(test_class, name) \ | 158 #define VIEW_TEST(test_class, name) \ |
| 159 TEST_F(test_class, name) {\ | 159 TEST_F(test_class, name) {\ |
| 160 StartMessageLoopAndRunTest();\ | 160 StartMessageLoopAndRunTest();\ |
| 161 } | 161 } |
| 162 | 162 |
| 163 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) | 163 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) |
| 164 | 164 |
| 165 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ | 165 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ |
| OLD | NEW |