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

Side by Side Diff: ui/views/cocoa/bridged_native_widget_unittest.mm

Issue 2119813002: views::Textfield: Implement yank editing command. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review. Created 4 years, 4 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/cocoa/bridged_content_view.mm ('k') | ui/views/controls/textfield/textfield.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 #import "ui/views/cocoa/bridged_native_widget.h" 5 #import "ui/views/cocoa/bridged_native_widget.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
11 #import "base/mac/foundation_util.h" 11 #import "base/mac/foundation_util.h"
12 #import "base/mac/mac_util.h" 12 #import "base/mac/mac_util.h"
13 #import "base/mac/sdk_forward_declarations.h" 13 #import "base/mac/sdk_forward_declarations.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/strings/sys_string_conversions.h" 17 #include "base/strings/sys_string_conversions.h"
18 #include "base/strings/utf_string_conversions.h" 18 #include "base/strings/utf_string_conversions.h"
19 #import "testing/gtest_mac.h" 19 #import "testing/gtest_mac.h"
20 #import "ui/base/cocoa/window_size_constants.h" 20 #import "ui/base/cocoa/window_size_constants.h"
21 #include "ui/base/ime/input_method.h" 21 #include "ui/base/ime/input_method.h"
22 #import "ui/gfx/mac/coordinate_conversion.h" 22 #import "ui/gfx/mac/coordinate_conversion.h"
23 #import "ui/gfx/test/ui_cocoa_test_helper.h" 23 #import "ui/gfx/test/ui_cocoa_test_helper.h"
24 #import "ui/views/cocoa/bridged_content_view.h" 24 #import "ui/views/cocoa/bridged_content_view.h"
25 #import "ui/views/cocoa/native_widget_mac_nswindow.h" 25 #import "ui/views/cocoa/native_widget_mac_nswindow.h"
26 #import "ui/views/cocoa/views_nswindow_delegate.h" 26 #import "ui/views/cocoa/views_nswindow_delegate.h"
27 #include "ui/views/controls/textfield/textfield.h" 27 #include "ui/views/controls/textfield/textfield.h"
28 #include "ui/views/controls/textfield/textfield_model.h"
28 #include "ui/views/view.h" 29 #include "ui/views/view.h"
29 #include "ui/views/widget/native_widget_mac.h" 30 #include "ui/views/widget/native_widget_mac.h"
30 #include "ui/views/widget/root_view.h" 31 #include "ui/views/widget/root_view.h"
31 #include "ui/views/widget/widget.h" 32 #include "ui/views/widget/widget.h"
32 #include "ui/views/widget/widget_observer.h" 33 #include "ui/views/widget/widget_observer.h"
33 34
34 using base::ASCIIToUTF16; 35 using base::ASCIIToUTF16;
35 using base::SysNSStringToUTF8; 36 using base::SysNSStringToUTF8;
36 using base::SysNSStringToUTF16; 37 using base::SysNSStringToUTF16;
37 using base::SysUTF8ToNSString; 38 using base::SysUTF8ToNSString;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 @"moveToRightEndOfLineAndModifySelection:" 107 @"moveToRightEndOfLineAndModifySelection:"
107 ]; 108 ];
108 109
109 NSArray* const kDeleteActions = @[ 110 NSArray* const kDeleteActions = @[
110 @"deleteForward:", @"deleteBackward:", @"deleteWordForward:", 111 @"deleteForward:", @"deleteBackward:", @"deleteWordForward:",
111 @"deleteWordBackward:", @"deleteToBeginningOfLine:", @"deleteToEndOfLine:", 112 @"deleteWordBackward:", @"deleteToBeginningOfLine:", @"deleteToEndOfLine:",
112 @"deleteToBeginningOfParagraph:", @"deleteToEndOfParagraph:" 113 @"deleteToBeginningOfParagraph:", @"deleteToEndOfParagraph:"
113 ]; 114 ];
114 115
115 NSArray* const kMiscActions = 116 NSArray* const kMiscActions =
116 @[ @"insertText:", @"cancelOperation:", @"transpose:" ]; 117 @[ @"insertText:", @"cancelOperation:", @"transpose:", @"yank:" ];
117 118
118 // Empty range shortcut for readibility. 119 // Empty range shortcut for readibility.
119 NSRange EmptyRange() { 120 NSRange EmptyRange() {
120 return NSMakeRange(NSNotFound, 0); 121 return NSMakeRange(NSNotFound, 0);
121 } 122 }
122 123
123 // Sets |composition_text| as the composition text with caret placed at 124 // Sets |composition_text| as the composition text with caret placed at
124 // |caret_pos| and updates |caret_range|. 125 // |caret_pos| and updates |caret_range|.
125 void SetCompositionText(ui::TextInputClient* client, 126 void SetCompositionText(ui::TextInputClient* client,
126 const base::string16& composition_text, 127 const base::string16& composition_text,
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 EXPECT_TRUE([window delegate]); 443 EXPECT_TRUE([window delegate]);
443 bridge()->SetRootView(view_.get()); 444 bridge()->SetRootView(view_.get());
444 ns_view_ = bridge()->ns_view(); 445 ns_view_ = bridge()->ns_view();
445 446
446 // Pretend it has been shown via NativeWidgetMac::Show(). 447 // Pretend it has been shown via NativeWidgetMac::Show().
447 [window orderFront:nil]; 448 [window orderFront:nil];
448 [test_window() makePretendKeyWindowAndSetFirstResponder:bridge()->ns_view()]; 449 [test_window() makePretendKeyWindowAndSetFirstResponder:bridge()->ns_view()];
449 } 450 }
450 451
451 void BridgedNativeWidgetTest::TearDown() { 452 void BridgedNativeWidgetTest::TearDown() {
453 // Clear kill buffer so that no state persists between tests.
454 TextfieldModel::ClearKillBuffer();
455
452 if (bridge()) 456 if (bridge())
453 bridge()->SetRootView(nullptr); 457 bridge()->SetRootView(nullptr);
454 view_.reset(); 458 view_.reset();
455 BridgedNativeWidgetTestBase::TearDown(); 459 BridgedNativeWidgetTestBase::TearDown();
456 } 460 }
457 461
458 void BridgedNativeWidgetTest::TestDeleteBeginning(SEL sel) { 462 void BridgedNativeWidgetTest::TestDeleteBeginning(SEL sel) {
459 InstallTextField("foo bar baz"); 463 InstallTextField("foo bar baz");
460 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(), 464 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(),
461 GetActualSelectionRange()); 465 GetActualSelectionRange());
(...skipping 14 matching lines...) Expand all
476 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(), 480 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
477 GetActualSelectionRange()); 481 GetActualSelectionRange());
478 482
479 // Make a selection as- " bar |baz|". 483 // Make a selection as- " bar |baz|".
480 SetSelectionRange(NSMakeRange(5, 3)); 484 SetSelectionRange(NSMakeRange(5, 3));
481 PerformCommand(sel); 485 PerformCommand(sel);
482 // Verify only the selection is deleted so that the state is " bar |". 486 // Verify only the selection is deleted so that the state is " bar |".
483 EXPECT_NSEQ_3(@" bar ", GetExpectedText(), GetActualText()); 487 EXPECT_NSEQ_3(@" bar ", GetExpectedText(), GetActualText());
484 EXPECT_EQ_RANGE_3(NSMakeRange(5, 0), GetExpectedSelectionRange(), 488 EXPECT_EQ_RANGE_3(NSMakeRange(5, 0), GetExpectedSelectionRange(),
485 GetActualSelectionRange()); 489 GetActualSelectionRange());
490
491 // Verify yanking inserts the deleted text.
492 PerformCommand(@selector(yank:));
493 EXPECT_NSEQ_3(@" bar baz", GetExpectedText(), GetActualText());
494 EXPECT_EQ_RANGE_3(NSMakeRange(8, 0), GetExpectedSelectionRange(),
495 GetActualSelectionRange());
486 } 496 }
487 497
488 void BridgedNativeWidgetTest::TestDeleteEnd(SEL sel) { 498 void BridgedNativeWidgetTest::TestDeleteEnd(SEL sel) {
489 InstallTextField("foo bar baz"); 499 InstallTextField("foo bar baz");
490 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(), 500 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(),
491 GetActualSelectionRange()); 501 GetActualSelectionRange());
492 502
493 // Caret is at the end of the line. Verify no deletion takes place. 503 // Caret is at the end of the line. Verify no deletion takes place.
494 PerformCommand(sel); 504 PerformCommand(sel);
495 EXPECT_NSEQ_3(@"foo bar baz", GetExpectedText(), GetActualText()); 505 EXPECT_NSEQ_3(@"foo bar baz", GetExpectedText(), GetActualText());
496 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(), 506 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(),
497 GetActualSelectionRange()); 507 GetActualSelectionRange());
498 508
499 // Move the caret as- "foo bar| baz". 509 // Move the caret as- "foo bar| baz".
500 SetSelectionRange(NSMakeRange(7, 0)); 510 SetSelectionRange(NSMakeRange(7, 0));
501 PerformCommand(sel); 511 PerformCommand(sel);
502 // Verify state is "foo bar|". 512 // Verify state is "foo bar|".
503 EXPECT_NSEQ_3(@"foo bar", GetExpectedText(), GetActualText()); 513 EXPECT_NSEQ_3(@"foo bar", GetExpectedText(), GetActualText());
504 EXPECT_EQ_RANGE_3(NSMakeRange(7, 0), GetExpectedSelectionRange(), 514 EXPECT_EQ_RANGE_3(NSMakeRange(7, 0), GetExpectedSelectionRange(),
505 GetActualSelectionRange()); 515 GetActualSelectionRange());
506 516
507 // Make a selection as- "|foo |bar". 517 // Make a selection as- "|foo |bar".
508 SetSelectionRange(NSMakeRange(0, 4)); 518 SetSelectionRange(NSMakeRange(0, 4));
509 PerformCommand(sel); 519 PerformCommand(sel);
510 // Verify only the selection is deleted so that the state is "|bar". 520 // Verify only the selection is deleted so that the state is "|bar".
511 EXPECT_NSEQ_3(@"bar", GetExpectedText(), GetActualText()); 521 EXPECT_NSEQ_3(@"bar", GetExpectedText(), GetActualText());
512 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(), 522 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
513 GetActualSelectionRange()); 523 GetActualSelectionRange());
524
525 // Verify yanking inserts the deleted text.
526 PerformCommand(@selector(yank:));
527 EXPECT_NSEQ_3(@"foo bar", GetExpectedText(), GetActualText());
528 EXPECT_EQ_RANGE_3(NSMakeRange(4, 0), GetExpectedSelectionRange(),
529 GetActualSelectionRange());
514 } 530 }
515 531
516 void BridgedNativeWidgetTest::TestEditingCommands(NSArray* selectors) { 532 void BridgedNativeWidgetTest::TestEditingCommands(NSArray* selectors) {
517 const base::string16 test_strings[] = { 533 const base::string16 test_strings[] = {
518 base::WideToUTF16(L"ab c"), 534 base::WideToUTF16(L"ab c"),
519 base::WideToUTF16(L"\x0634\x0632 \x064A") // RTL string. 535 base::WideToUTF16(L"\x0634\x0632 \x064A") // RTL string.
520 }; 536 };
521 537
522 for (const base::string16& test_string : test_strings) { 538 for (const base::string16& test_string : test_strings) {
523 for (NSString* selector_string in selectors) { 539 for (NSString* selector_string in selectors) {
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 InstallTextField("a"); 906 InstallTextField("a");
891 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(), 907 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(),
892 GetActualSelectionRange()); 908 GetActualSelectionRange());
893 909
894 // Delete one character. 910 // Delete one character.
895 PerformCommand(@selector(deleteBackward:)); 911 PerformCommand(@selector(deleteBackward:));
896 EXPECT_NSEQ_3(nil, GetExpectedText(), GetActualText()); 912 EXPECT_NSEQ_3(nil, GetExpectedText(), GetActualText());
897 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(), 913 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
898 GetActualSelectionRange()); 914 GetActualSelectionRange());
899 915
916 // Verify that deletion did not modify the kill buffer.
917 PerformCommand(@selector(yank:));
918 EXPECT_NSEQ_3(nil, GetExpectedText(), GetActualText());
919 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
920 GetActualSelectionRange());
921
900 // Try to delete again on an empty string. 922 // Try to delete again on an empty string.
901 PerformCommand(@selector(deleteBackward:)); 923 PerformCommand(@selector(deleteBackward:));
902 EXPECT_NSEQ_3(nil, GetExpectedText(), GetActualText()); 924 EXPECT_NSEQ_3(nil, GetExpectedText(), GetActualText());
903 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(), 925 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
904 GetActualSelectionRange()); 926 GetActualSelectionRange());
905 } 927 }
906 928
907 // Test forward delete using text input protocol. 929 // Test forward delete using text input protocol.
908 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteForward) { 930 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteForward) {
909 InstallTextField("a"); 931 InstallTextField("a");
910 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(), 932 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(),
911 GetActualSelectionRange()); 933 GetActualSelectionRange());
912 934
913 // At the end of the string, can't delete forward. 935 // At the end of the string, can't delete forward.
914 PerformCommand(@selector(deleteForward:)); 936 PerformCommand(@selector(deleteForward:));
915 EXPECT_NSEQ_3(@"a", GetExpectedText(), GetActualText()); 937 EXPECT_NSEQ_3(@"a", GetExpectedText(), GetActualText());
916 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(), 938 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(),
917 GetActualSelectionRange()); 939 GetActualSelectionRange());
918 940
919 // Should succeed after moving left first. 941 // Should succeed after moving left first.
920 PerformCommand(@selector(moveLeft:)); 942 PerformCommand(@selector(moveLeft:));
921 PerformCommand(@selector(deleteForward:)); 943 PerformCommand(@selector(deleteForward:));
922 EXPECT_NSEQ_3(nil, GetExpectedText(), GetActualText()); 944 EXPECT_NSEQ_3(nil, GetExpectedText(), GetActualText());
923 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(), 945 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
924 GetActualSelectionRange()); 946 GetActualSelectionRange());
947
948 // Verify that deletion did not modify the kill buffer.
949 PerformCommand(@selector(yank:));
950 EXPECT_NSEQ_3(nil, GetExpectedText(), GetActualText());
951 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
952 GetActualSelectionRange());
925 } 953 }
926 954
927 // Test forward word deletion using text input protocol. 955 // Test forward word deletion using text input protocol.
928 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteWordForward) { 956 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteWordForward) {
929 InstallTextField("foo bar baz"); 957 InstallTextField("foo bar baz");
930 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(), 958 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(),
931 GetActualSelectionRange()); 959 GetActualSelectionRange());
932 960
933 // Caret is at the end of the line. Verify no deletion takes place. 961 // Caret is at the end of the line. Verify no deletion takes place.
934 PerformCommand(@selector(deleteWordForward:)); 962 PerformCommand(@selector(deleteWordForward:));
935 EXPECT_NSEQ_3(@"foo bar baz", GetExpectedText(), GetActualText()); 963 EXPECT_NSEQ_3(@"foo bar baz", GetExpectedText(), GetActualText());
936 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(), 964 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(),
937 GetActualSelectionRange()); 965 GetActualSelectionRange());
938 966
939 // Move the caret as- "foo b|ar baz". 967 // Move the caret as- "foo b|ar baz".
940 SetSelectionRange(NSMakeRange(5, 0)); 968 SetSelectionRange(NSMakeRange(5, 0));
941 PerformCommand(@selector(deleteWordForward:)); 969 PerformCommand(@selector(deleteWordForward:));
942 // Verify state is "foo b| baz" 970 // Verify state is "foo b| baz"
943 EXPECT_NSEQ_3(@"foo b baz", GetExpectedText(), GetActualText()); 971 EXPECT_NSEQ_3(@"foo b baz", GetExpectedText(), GetActualText());
944 EXPECT_EQ_RANGE_3(NSMakeRange(5, 0), GetExpectedSelectionRange(), 972 EXPECT_EQ_RANGE_3(NSMakeRange(5, 0), GetExpectedSelectionRange(),
945 GetActualSelectionRange()); 973 GetActualSelectionRange());
946 974
947 // Make a selection as- "|fo|o b baz". 975 // Make a selection as- "|fo|o b baz".
948 SetSelectionRange(NSMakeRange(0, 2)); 976 SetSelectionRange(NSMakeRange(0, 2));
949 PerformCommand(@selector(deleteWordForward:)); 977 PerformCommand(@selector(deleteWordForward:));
950 // Verify only the selection is deleted and state is "|o b baz". 978 // Verify only the selection is deleted and state is "|o b baz".
951 EXPECT_NSEQ_3(@"o b baz", GetExpectedText(), GetActualText()); 979 EXPECT_NSEQ_3(@"o b baz", GetExpectedText(), GetActualText());
952 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(), 980 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
953 GetActualSelectionRange()); 981 GetActualSelectionRange());
982
983 // Verify that deletion did not modify the kill buffer.
984 PerformCommand(@selector(yank:));
985 EXPECT_NSEQ_3(@"o b baz", GetExpectedText(), GetActualText());
986 EXPECT_EQ_RANGE_3(NSMakeRange(0, 0), GetExpectedSelectionRange(),
987 GetActualSelectionRange());
954 } 988 }
955 989
956 // Test backward word deletion using text input protocol. 990 // Test backward word deletion using text input protocol.
957 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteWordBackward) { 991 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteWordBackward) {
958 InstallTextField("foo bar baz"); 992 InstallTextField("foo bar baz");
959 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(), 993 EXPECT_EQ_RANGE_3(NSMakeRange(11, 0), GetExpectedSelectionRange(),
960 GetActualSelectionRange()); 994 GetActualSelectionRange());
961 995
962 // Move the caret to the beginning of the line. 996 // Move the caret to the beginning of the line.
963 SetSelectionRange(NSMakeRange(0, 0)); 997 SetSelectionRange(NSMakeRange(0, 0));
(...skipping 11 matching lines...) Expand all
975 EXPECT_EQ_RANGE_3(NSMakeRange(4, 0), GetExpectedSelectionRange(), 1009 EXPECT_EQ_RANGE_3(NSMakeRange(4, 0), GetExpectedSelectionRange(),
976 GetActualSelectionRange()); 1010 GetActualSelectionRange());
977 1011
978 // Make a selection as- "f|oo r b|az". 1012 // Make a selection as- "f|oo r b|az".
979 SetSelectionRange(NSMakeRange(1, 6)); 1013 SetSelectionRange(NSMakeRange(1, 6));
980 PerformCommand(@selector(deleteWordBackward:)); 1014 PerformCommand(@selector(deleteWordBackward:));
981 // Verify only the selection is deleted and state is "f|az" 1015 // Verify only the selection is deleted and state is "f|az"
982 EXPECT_NSEQ_3(@"faz", GetExpectedText(), GetActualText()); 1016 EXPECT_NSEQ_3(@"faz", GetExpectedText(), GetActualText());
983 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(), 1017 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(),
984 GetActualSelectionRange()); 1018 GetActualSelectionRange());
1019
1020 // Verify that deletion did not modify the kill buffer.
1021 PerformCommand(@selector(yank:));
1022 EXPECT_NSEQ_3(@"faz", GetExpectedText(), GetActualText());
1023 EXPECT_EQ_RANGE_3(NSMakeRange(1, 0), GetExpectedSelectionRange(),
1024 GetActualSelectionRange());
985 } 1025 }
986 1026
987 // Test deleting to beginning/end of line/paragraph using text input protocol. 1027 // Test deleting to beginning/end of line/paragraph using text input protocol.
988 1028
989 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteToBeginningOfLine) { 1029 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteToBeginningOfLine) {
990 TestDeleteBeginning(@selector(deleteToBeginningOfLine:)); 1030 TestDeleteBeginning(@selector(deleteToBeginningOfLine:));
991 } 1031 }
992 1032
993 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteToEndOfLine) { 1033 TEST_F(BridgedNativeWidgetTest, TextInput_DeleteToEndOfLine) {
994 TestDeleteEnd(@selector(deleteToEndOfLine:)); 1034 TestDeleteEnd(@selector(deleteToEndOfLine:));
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 [center postNotificationName:NSWindowDidExitFullScreenNotification 1236 [center postNotificationName:NSWindowDidExitFullScreenNotification
1197 object:window]; 1237 object:window];
1198 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change. 1238 EXPECT_EQ(1, [window ignoredToggleFullScreenCount]); // No change.
1199 EXPECT_FALSE(bridge()->target_fullscreen_state()); 1239 EXPECT_FALSE(bridge()->target_fullscreen_state());
1200 1240
1201 widget_->CloseNow(); 1241 widget_->CloseNow();
1202 } 1242 }
1203 1243
1204 } // namespace test 1244 } // namespace test
1205 } // namespace views 1245 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/cocoa/bridged_content_view.mm ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698