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

Side by Side Diff: views/touchui/touch_selection_controller_impl_unittest.cc

Issue 7720020: Get views_unittests pass on touch build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: enable TouchSelectionControllerImplTest as they're fixed Created 9 years, 4 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
« no previous file with comments | « views/test/views_test_base.cc ('k') | views/view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "ui/gfx/point.h" 6 #include "ui/gfx/point.h"
7 #include "ui/gfx/rect.h" 7 #include "ui/gfx/rect.h"
8 #include "ui/gfx/render_text.h" 8 #include "ui/gfx/render_text.h"
9 #include "views/controls/textfield/native_textfield_views.h" 9 #include "views/controls/textfield/native_textfield_views.h"
10 #include "views/controls/textfield/textfield.h" 10 #include "views/controls/textfield/textfield.h"
11 #include "views/test/views_test_base.h" 11 #include "views/test/views_test_base.h"
12 #include "views/touchui/touch_selection_controller.h" 12 #include "views/touchui/touch_selection_controller.h"
13 #include "views/touchui/touch_selection_controller_impl.h" 13 #include "views/touchui/touch_selection_controller_impl.h"
14 #include "views/widget/widget.h" 14 #include "views/widget/widget.h"
15 15
16 namespace views { 16 namespace views {
17 17
18 class TouchSelectionControllerImplTest : public ViewsTestBase { 18 class TouchSelectionControllerImplTest : public ViewsTestBase {
19 public: 19 public:
20 TouchSelectionControllerImplTest() 20 TouchSelectionControllerImplTest()
21 : widget_(NULL), 21 : widget_(NULL),
22 textfield_(NULL), 22 textfield_(NULL),
23 textfield_view_(NULL) { 23 textfield_view_(NULL) {
24 } 24 }
25 25
26 virtual void SetUp() {
27 Widget::SetPureViews(true);
28 }
29
30 virtual void TearDown() { 26 virtual void TearDown() {
31 Widget::SetPureViews(false);
32 if (widget_) 27 if (widget_)
33 widget_->Close(); 28 widget_->Close();
34 ViewsTestBase::TearDown(); 29 ViewsTestBase::TearDown();
35 } 30 }
36 31
37 void CreateTextfield() { 32 void CreateTextfield() {
38 textfield_ = new Textfield(); 33 textfield_ = new Textfield();
39 widget_ = new Widget; 34 widget_ = new Widget;
40 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); 35 Widget::InitParams params(Widget::InitParams::TYPE_POPUP);
41 params.bounds = gfx::Rect(0, 0, 200, 200); 36 params.bounds = gfx::Rect(0, 0, 200, 200);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 VerifySelectionHandlePositions(true); 170 VerifySelectionHandlePositions(true);
176 171
177 // Drag selection handle 2 across selection handle 1. 172 // Drag selection handle 2 across selection handle 1.
178 x = textfield_->font().GetStringWidth(ASCIIToUTF16("with selected ")); 173 x = textfield_->font().GetStringWidth(ASCIIToUTF16("with selected "));
179 SimulateSelectionHandleDrag(gfx::Point(x, 0), 2); 174 SimulateSelectionHandleDrag(gfx::Point(x, 0), 2);
180 EXPECT_EQ(UTF16ToUTF8(textfield_->GetSelectedText()), "selected "); 175 EXPECT_EQ(UTF16ToUTF8(textfield_->GetSelectedText()), "selected ");
181 VerifySelectionHandlePositions(false); 176 VerifySelectionHandlePositions(false);
182 } 177 }
183 178
184 } // namespace views 179 } // namespace views
OLDNEW
« no previous file with comments | « views/test/views_test_base.cc ('k') | views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698