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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 // Overridden from views::WidgetDelegate: | 82 // Overridden from views::WidgetDelegate: |
83 virtual bool CanResize() const OVERRIDE; | 83 virtual bool CanResize() const OVERRIDE; |
84 virtual views::View* GetContentsView() OVERRIDE; | 84 virtual views::View* GetContentsView() OVERRIDE; |
85 virtual const views::Widget* GetWidget() const OVERRIDE; | 85 virtual const views::Widget* GetWidget() const OVERRIDE; |
86 virtual views::Widget* GetWidget() OVERRIDE; | 86 virtual views::Widget* GetWidget() OVERRIDE; |
87 | 87 |
88 // Overridden to do nothing so that this class can be used in runnable tasks. | 88 // Overridden to do nothing so that this class can be used in runnable tasks. |
89 void AddRef() {} | 89 void AddRef() {} |
90 void Release() {} | 90 void Release() {} |
91 static bool ImplementsThreadSafeReferenceCounting() { return false; } | |
92 | 91 |
93 protected: | 92 protected: |
94 virtual ~ViewEventTestBase(); | 93 virtual ~ViewEventTestBase(); |
95 | 94 |
96 // Returns the view that is added to the window. | 95 // Returns the view that is added to the window. |
97 virtual views::View* CreateContentsView() = 0; | 96 virtual views::View* CreateContentsView() = 0; |
98 | 97 |
99 // Called once the message loop is running. | 98 // Called once the message loop is running. |
100 virtual void DoTestOnMessageLoop() = 0; | 99 virtual void DoTestOnMessageLoop() = 0; |
101 | 100 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Convenience macro for defining a ViewEventTestBase. See class description | 149 // Convenience macro for defining a ViewEventTestBase. See class description |
151 // of ViewEventTestBase for details. | 150 // of ViewEventTestBase for details. |
152 #define VIEW_TEST(test_class, name) \ | 151 #define VIEW_TEST(test_class, name) \ |
153 TEST_F(test_class, name) {\ | 152 TEST_F(test_class, name) {\ |
154 StartMessageLoopAndRunTest();\ | 153 StartMessageLoopAndRunTest();\ |
155 } | 154 } |
156 | 155 |
157 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) | 156 #endif // defined(HAS_OUT_OF_PROC_TEST_RUNNER) |
158 | 157 |
159 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ | 158 #endif // CHROME_TEST_BASE_VIEW_EVENT_TEST_BASE_H_ |
OLD | NEW |