Chromium Code Reviews| Index: ui/views/cocoa/bridged_native_widget_unittest.mm |
| diff --git a/ui/views/cocoa/bridged_native_widget_unittest.mm b/ui/views/cocoa/bridged_native_widget_unittest.mm |
| index 61b7f498124920fdfb0e6de59f7b51db3d2f4ee0..4554eee36a5155c614f9e5d7cec497da7f4d048a 100644 |
| --- a/ui/views/cocoa/bridged_native_widget_unittest.mm |
| +++ b/ui/views/cocoa/bridged_native_widget_unittest.mm |
| @@ -112,7 +112,8 @@ NSArray* const kDeleteActions = @[ |
| @"deleteToBeginningOfParagraph:", @"deleteToEndOfParagraph:" |
| ]; |
| -NSArray* const kMiscActions = @[ @"insertText:", @"cancelOperation:" ]; |
| +NSArray* const kMiscActions = |
| + @[ @"insertText:", @"cancelOperation:", @"transpose:" ]; |
| // Empty range shortcut for readibility. |
| NSRange EmptyRange() { |
| @@ -361,8 +362,10 @@ void BridgedNativeWidgetTest::InstallTextField( |
| [ns_view_ setTextInputClient:textfield]; |
| - // Initialize the dummy text view. |
| - dummy_text_view_.reset([[NSTextView alloc] initWithFrame:NSZeroRect]); |
| + // Initialize the dummy text view. Initializing this with NSZeroRect causes |
| + // weird NSTextView behavior on OSX 10.9. |
| + dummy_text_view_.reset( |
| + [[NSTextView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)]); |
|
tapted
2016/06/29 07:06:14
probs need to rebase this bit
karandeepb
2016/06/29 07:33:45
Done.
|
| [dummy_text_view_ setString:SysUTF16ToNSString(text)]; |
| } |
| @@ -1001,9 +1004,6 @@ TEST_F(BridgedNativeWidgetTest, TextInput_DeleteToEndOfParagraph) { |
| // Test move commands against expectations set by |dummy_text_view_|. |
| TEST_F(BridgedNativeWidgetTest, TextInput_MoveEditingCommands) { |
| - // Broken on 10.9. http://crbug.com/621734. |
| - if (base::mac::IsOSMavericks()) |
| - return; |
| TestEditingCommands(kMoveActions); |
| } |
| @@ -1017,9 +1017,6 @@ TEST_F(BridgedNativeWidgetTest, |
| // Test delete commands against expectations set by |dummy_text_view_|. |
| TEST_F(BridgedNativeWidgetTest, TextInput_DeleteCommands) { |
| - // Broken on 10.9. http://crbug.com/621734. |
| - if (base::mac::IsOSMavericks()) |
| - return; |
| TestEditingCommands(kDeleteActions); |
| } |
| @@ -1037,6 +1034,11 @@ TEST_F(BridgedNativeWidgetTest, NilTextInputClient) { |
| [ns_view_ doCommandBySelector:NSSelectorFromString(selector)]; |
| } |
| +// Test transpose command against expectations set by |dummy_text_view_|. |
| +TEST_F(BridgedNativeWidgetTest, TextInput_Transpose) { |
| + TestEditingCommands(@[ @"transpose:" ]); |
| +} |
| + |
| // Test firstRectForCharacterRange:actualRange for cases where query range is |
| // empty or outside composition range. |
| TEST_F(BridgedNativeWidgetTest, TextInput_FirstRectForCharacterRange_Caret) { |