OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |