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

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

Issue 2010083002: views/mus: Run some more tests from views_unittests in mus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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/slider_unittest.cc ('k') | ui/views/event_monitor_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 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 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 model_->ClearEditHistory(); 433 model_->ClearEditHistory();
434 434
435 // Since the window type is activatable, showing the widget will also 435 // Since the window type is activatable, showing the widget will also
436 // activate it. Calling Activate directly is insufficient, since that does 436 // activate it. Calling Activate directly is insufficient, since that does
437 // not also _focus_ an aura::Window (i.e. using the FocusClient). Both the 437 // not also _focus_ an aura::Window (i.e. using the FocusClient). Both the
438 // widget and the textfield must have focus to properly handle input. 438 // widget and the textfield must have focus to properly handle input.
439 widget_->Show(); 439 widget_->Show();
440 textfield_->RequestFocus(); 440 textfield_->RequestFocus();
441 441
442 event_generator_.reset( 442 event_generator_.reset(
443 new ui::test::EventGenerator(GetContext(), widget_->GetNativeWindow())); 443 new ui::test::EventGenerator(widget_->GetNativeWindow()));
444 } 444 }
445 ui::MenuModel* GetContextMenuModel() { 445 ui::MenuModel* GetContextMenuModel() {
446 test_api_->UpdateContextMenu(); 446 test_api_->UpdateContextMenu();
447 return test_api_->context_menu_contents(); 447 return test_api_->context_menu_contents();
448 } 448 }
449 449
450 // True if native Mac keystrokes should be used (to avoid ifdef litter). 450 // True if native Mac keystrokes should be used (to avoid ifdef litter).
451 bool TestingNativeMac() { 451 bool TestingNativeMac() {
452 #if defined(OS_MACOSX) 452 #if defined(OS_MACOSX)
453 return true; 453 return true;
(...skipping 2200 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 2654
2655 textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); 2655 textfield_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
2656 ui::AXViewState state_protected; 2656 ui::AXViewState state_protected;
2657 textfield_->GetAccessibleState(&state_protected); 2657 textfield_->GetAccessibleState(&state_protected);
2658 EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, state_protected.role); 2658 EXPECT_EQ(ui::AX_ROLE_TEXT_FIELD, state_protected.role);
2659 EXPECT_EQ(ASCIIToUTF16("********"), state_protected.value); 2659 EXPECT_EQ(ASCIIToUTF16("********"), state_protected.value);
2660 EXPECT_TRUE(state_protected.HasStateFlag(ui::AX_STATE_PROTECTED)); 2660 EXPECT_TRUE(state_protected.HasStateFlag(ui::AX_STATE_PROTECTED));
2661 } 2661 }
2662 2662
2663 } // namespace views 2663 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/slider_unittest.cc ('k') | ui/views/event_monitor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698