Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Side by Side Diff: chrome/test/interactive_ui/view_event_test_base.cc

Issue 7344: Convert GetPreferredSize from:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/automation/ui_controls.h" 8 #include "chrome/browser/automation/ui_controls.h"
9 #include "chrome/views/view.h" 9 #include "chrome/views/view.h"
10 #include "chrome/views/window.h" 10 #include "chrome/views/window.h"
11 11
12 namespace { 12 namespace {
13 13
14 // View subclass that allows you to specify the preferred size. 14 // View subclass that allows you to specify the preferred size.
15 class TestView : public ChromeViews::View { 15 class TestView : public ChromeViews::View {
16 public: 16 public:
17 TestView() {} 17 TestView() {}
18 18
19 void set_preferred_size(const gfx::Size& size) { preferred_size_ = size; } 19 void set_preferred_size(const gfx::Size& size) { preferred_size_ = size; }
20 void GetPreferredSize(CSize* out) { 20 gfx::Size GetPreferredSize() {
21 if (!preferred_size_.IsEmpty()) 21 if (!preferred_size_.IsEmpty())
22 *out = preferred_size_.ToSIZE(); 22 return preferred_size_;
23 else 23 return View::GetPreferredSize();
24 View::GetPreferredSize(out);
25 } 24 }
26 25
27 private: 26 private:
28 gfx::Size preferred_size_; 27 gfx::Size preferred_size_;
29 28
30 DISALLOW_COPY_AND_ASSIGN(TestView); 29 DISALLOW_COPY_AND_ASSIGN(TestView);
31 }; 30 };
32 31
33 // Delay in background thread before posting mouse move. 32 // Delay in background thread before posting mouse move.
34 const int kMouseMoveDelayMS = 200; 33 const int kMouseMoveDelayMS = 200;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 } 108 }
110 109
111 void ViewEventTestBase::RunTestMethod(Task* task) { 110 void ViewEventTestBase::RunTestMethod(Task* task) {
112 StopBackgroundThread(); 111 StopBackgroundThread();
113 112
114 scoped_ptr<Task> task_deleter(task); 113 scoped_ptr<Task> task_deleter(task);
115 task->Run(); 114 task->Run();
116 if (HasFatalFailure()) 115 if (HasFatalFailure())
117 Done(); 116 Done();
118 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698