OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/controls/textfield/textfield.h" | 5 #include "ui/views/controls/textfield/textfield.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 : widget_(NULL), | 152 : widget_(NULL), |
153 textfield_(NULL), | 153 textfield_(NULL), |
154 model_(NULL), | 154 model_(NULL), |
155 input_method_(NULL), | 155 input_method_(NULL), |
156 on_before_user_action_(0), | 156 on_before_user_action_(0), |
157 on_after_user_action_(0), | 157 on_after_user_action_(0), |
158 copied_to_clipboard_(ui::CLIPBOARD_TYPE_LAST) { | 158 copied_to_clipboard_(ui::CLIPBOARD_TYPE_LAST) { |
159 } | 159 } |
160 | 160 |
161 // ::testing::Test: | 161 // ::testing::Test: |
162 void SetUp() override { ViewsTestBase::SetUp(); } | |
163 | |
164 void TearDown() override { | 162 void TearDown() override { |
165 if (widget_) | 163 if (widget_) |
166 widget_->Close(); | 164 widget_->Close(); |
167 ViewsTestBase::TearDown(); | 165 ViewsTestBase::TearDown(); |
168 } | 166 } |
169 | 167 |
170 ui::ClipboardType GetAndResetCopiedToClipboard() { | 168 ui::ClipboardType GetAndResetCopiedToClipboard() { |
171 ui::ClipboardType clipboard_type = copied_to_clipboard_; | 169 ui::ClipboardType clipboard_type = copied_to_clipboard_; |
172 copied_to_clipboard_ = ui::CLIPBOARD_TYPE_LAST; | 170 copied_to_clipboard_ = ui::CLIPBOARD_TYPE_LAST; |
173 return clipboard_type; | 171 return clipboard_type; |
(...skipping 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2062 TextfieldDestroyerController controller(textfield_); | 2060 TextfieldDestroyerController controller(textfield_); |
2063 EXPECT_TRUE(controller.target()); | 2061 EXPECT_TRUE(controller.target()); |
2064 | 2062 |
2065 // Send a key to trigger OnKeyEvent(). | 2063 // Send a key to trigger OnKeyEvent(). |
2066 SendKeyEvent('X'); | 2064 SendKeyEvent('X'); |
2067 | 2065 |
2068 EXPECT_FALSE(controller.target()); | 2066 EXPECT_FALSE(controller.target()); |
2069 } | 2067 } |
2070 | 2068 |
2071 } // namespace views | 2069 } // namespace views |
OLD | NEW |