OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/test/interactive_ui/view_event_test_base.h" | 5 #include "chrome/test/interactive_ui/view_event_test_base.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <ole2.h> | 8 #include <ole2.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 PreferredSizeChanged(); | 28 PreferredSizeChanged(); |
29 } | 29 } |
30 | 30 |
31 gfx::Size GetPreferredSize() { | 31 gfx::Size GetPreferredSize() { |
32 if (!preferred_size_.IsEmpty()) | 32 if (!preferred_size_.IsEmpty()) |
33 return preferred_size_; | 33 return preferred_size_; |
34 return View::GetPreferredSize(); | 34 return View::GetPreferredSize(); |
35 } | 35 } |
36 | 36 |
37 virtual void Layout() { | 37 virtual void Layout() { |
38 View* child_view = GetChildViewAt(0); | 38 View* child_view = child_at(0); |
39 child_view->SetBounds(0, 0, width(), height()); | 39 child_view->SetBounds(0, 0, width(), height()); |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
43 gfx::Size preferred_size_; | 43 gfx::Size preferred_size_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(TestView); | 45 DISALLOW_COPY_AND_ASSIGN(TestView); |
46 }; | 46 }; |
47 | 47 |
48 // Delay in background thread before posting mouse move. | 48 // Delay in background thread before posting mouse move. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 | 163 |
164 void ViewEventTestBase::RunTestMethod(Task* task) { | 164 void ViewEventTestBase::RunTestMethod(Task* task) { |
165 StopBackgroundThread(); | 165 StopBackgroundThread(); |
166 | 166 |
167 scoped_ptr<Task> task_deleter(task); | 167 scoped_ptr<Task> task_deleter(task); |
168 task->Run(); | 168 task->Run(); |
169 if (HasFatalFailure()) | 169 if (HasFatalFailure()) |
170 Done(); | 170 Done(); |
171 } | 171 } |
OLD | NEW |