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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 public: | 72 public: |
73 ViewEventTestBase(); | 73 ViewEventTestBase(); |
74 | 74 |
75 // Invoke when done either because of failure or success. Quits the message | 75 // Invoke when done either because of failure or success. Quits the message |
76 // loop. | 76 // loop. |
77 void Done(); | 77 void Done(); |
78 | 78 |
79 static void SetUpTestCase(); | 79 static void SetUpTestCase(); |
80 | 80 |
81 // Creates a window. | 81 // Creates a window. |
82 virtual void SetUp() OVERRIDE; | 82 virtual void SetUp() override; |
83 | 83 |
84 // Destroys the window. | 84 // Destroys the window. |
85 virtual void TearDown() OVERRIDE; | 85 virtual void TearDown() override; |
86 | 86 |
87 // Overridden from views::WidgetDelegate: | 87 // Overridden from views::WidgetDelegate: |
88 virtual bool CanResize() const OVERRIDE; | 88 virtual bool CanResize() const override; |
89 virtual views::View* GetContentsView() OVERRIDE; | 89 virtual views::View* GetContentsView() override; |
90 virtual const views::Widget* GetWidget() const OVERRIDE; | 90 virtual const views::Widget* GetWidget() const override; |
91 virtual views::Widget* GetWidget() OVERRIDE; | 91 virtual views::Widget* GetWidget() override; |
92 | 92 |
93 // Overridden to do nothing so that this class can be used in runnable tasks. | 93 // Overridden to do nothing so that this class can be used in runnable tasks. |
94 void AddRef() {} | 94 void AddRef() {} |
95 void Release() {} | 95 void Release() {} |
96 | 96 |
97 protected: | 97 protected: |
98 virtual ~ViewEventTestBase(); | 98 virtual ~ViewEventTestBase(); |
99 | 99 |
100 // Returns the view that is added to the window. | 100 // Returns the view that is added to the window. |
101 virtual views::View* CreateContentsView() = 0; | 101 virtual views::View* CreateContentsView() = 0; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |