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 #include "chrome/test/base/view_event_test_base.h" | 5 #include "chrome/test/base/view_event_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "chrome/test/base/chrome_unit_test_suite.h" | 9 #include "chrome/test/base/chrome_unit_test_suite.h" |
10 #include "chrome/test/base/interactive_test_utils.h" | 10 #include "chrome/test/base/interactive_test_utils.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // View subclass that allows you to specify the preferred size. | 21 // View subclass that allows you to specify the preferred size. |
22 class TestView : public views::View { | 22 class TestView : public views::View { |
23 public: | 23 public: |
24 TestView() {} | 24 TestView() {} |
25 | 25 |
26 void SetPreferredSize(const gfx::Size& size) { | 26 void SetPreferredSize(const gfx::Size& size) { |
27 preferred_size_ = size; | 27 preferred_size_ = size; |
28 PreferredSizeChanged(); | 28 PreferredSizeChanged(); |
29 } | 29 } |
30 | 30 |
31 virtual gfx::Size GetPreferredSize() const OVERRIDE { | 31 virtual gfx::Size GetPreferredSize() const override { |
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() OVERRIDE { | 37 virtual void Layout() override { |
38 View* child_view = child_at(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 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 dnd_thread_.reset(NULL); | 166 dnd_thread_.reset(NULL); |
167 } | 167 } |
168 | 168 |
169 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { | 169 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { |
170 StopBackgroundThread(); | 170 StopBackgroundThread(); |
171 | 171 |
172 task.Run(); | 172 task.Run(); |
173 if (HasFatalFailure()) | 173 if (HasFatalFailure()) |
174 Done(); | 174 Done(); |
175 } | 175 } |
OLD | NEW |