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

Side by Side Diff: ui/views/controls/textfield/textfield_unittest.cc

Issue 2728433002: Unnecessarily cursor appears in omnibox after clicking inside the 'Search box' (Closed)
Patch Set: address comments Created 3 years, 9 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
« no previous file with comments | « ui/views/controls/textfield/textfield_test_api.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 3094 matching lines...) Expand 10 before | Expand all | Expand 10 after
3105 textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); 3105 textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
3106 ui::AXNodeData node_data_protected; 3106 ui::AXNodeData node_data_protected;
3107 node_data_protected.state = 0; 3107 node_data_protected.state = 0;
3108 textfield_->GetAccessibleNodeData(&node_data_protected); 3108 textfield_->GetAccessibleNodeData(&node_data_protected);
3109 EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, node_data_protected.role); 3109 EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, node_data_protected.role);
3110 EXPECT_EQ(ASCIIToUTF16("********"), 3110 EXPECT_EQ(ASCIIToUTF16("********"),
3111 node_data_protected.GetString16Attribute(ui::AX_ATTR_VALUE)); 3111 node_data_protected.GetString16Attribute(ui::AX_ATTR_VALUE));
3112 EXPECT_TRUE(node_data_protected.HasStateFlag(ui::AX_STATE_PROTECTED)); 3112 EXPECT_TRUE(node_data_protected.HasStateFlag(ui::AX_STATE_PROTECTED));
3113 } 3113 }
3114 3114
3115 // Test if the cursor visibility is controlled by |cursor_enabled_| in
3116 // RenderText.
3117 TEST_F(TextfieldTest, CursorVisibility) {
3118 InitTextfield();
3119 gfx::RenderText* render_text = test_api_->GetRenderText();
3120
3121 render_text->SetCursorEnabled(false);
3122 textfield_->OnBlur();
3123 textfield_->OnFocus();
3124 EXPECT_FALSE(test_api_->IsCursorVisible());
3125
3126 render_text->SetCursorEnabled(true);
3127 textfield_->OnBlur();
3128 textfield_->OnFocus();
3129 EXPECT_TRUE(test_api_->IsCursorVisible());
3130 }
3131
3115 } // namespace views 3132 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/textfield_test_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698