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

Side by Side Diff: views/controls/textfield/native_textfield_views_unittest.cc

Issue 7015051: Re-land: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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/controls/textfield/native_textfield_gtk.cc ('k') | views/examples/widget_example.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/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 } 150 }
151 151
152 void InitTextfield(Textfield::StyleFlags style) { 152 void InitTextfield(Textfield::StyleFlags style) {
153 InitTextfields(style, 1); 153 InitTextfields(style, 1);
154 } 154 }
155 155
156 void InitTextfields(Textfield::StyleFlags style, int count) { 156 void InitTextfields(Textfield::StyleFlags style, int count) {
157 ASSERT_FALSE(textfield_); 157 ASSERT_FALSE(textfield_);
158 textfield_ = new TestTextfield(style); 158 textfield_ = new TestTextfield(style);
159 textfield_->SetController(this); 159 textfield_->SetController(this);
160 widget_ = Widget::CreateWidget(); 160 widget_ = new Widget;
161 Widget::InitParams params(Widget::InitParams::TYPE_POPUP); 161 Widget::InitParams params(Widget::InitParams::TYPE_POPUP);
162 params.bounds = gfx::Rect(100, 100, 100, 100); 162 params.bounds = gfx::Rect(100, 100, 100, 100);
163 widget_->Init(params); 163 widget_->Init(params);
164 View* container = new View(); 164 View* container = new View();
165 widget_->SetContentsView(container); 165 widget_->SetContentsView(container);
166 container->AddChildView(textfield_); 166 container->AddChildView(textfield_);
167 167
168 textfield_view_ 168 textfield_view_
169 = static_cast<NativeTextfieldViews*>(textfield_->native_wrapper()); 169 = static_cast<NativeTextfieldViews*>(textfield_->native_wrapper());
170 textfield_->SetID(1); 170 textfield_->SetID(1);
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 EXPECT_STR_EQ("a23", textfield_->text()); 1046 EXPECT_STR_EQ("a23", textfield_->text());
1047 SendKeyEvent(ui::VKEY_B); 1047 SendKeyEvent(ui::VKEY_B);
1048 EXPECT_STR_EQ("ab3", textfield_->text()); 1048 EXPECT_STR_EQ("ab3", textfield_->text());
1049 SendKeyEvent(ui::VKEY_Z, false, true); 1049 SendKeyEvent(ui::VKEY_Z, false, true);
1050 EXPECT_STR_EQ("123", textfield_->text()); 1050 EXPECT_STR_EQ("123", textfield_->text());
1051 SendKeyEvent(ui::VKEY_Y, false, true); 1051 SendKeyEvent(ui::VKEY_Y, false, true);
1052 EXPECT_STR_EQ("ab3", textfield_->text()); 1052 EXPECT_STR_EQ("ab3", textfield_->text());
1053 } 1053 }
1054 1054
1055 } // namespace views 1055 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/textfield/native_textfield_gtk.cc ('k') | views/examples/widget_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698