OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/autofill/autofill_textfield.h" | 5 #import "chrome/browser/ui/cocoa/autofill/autofill_textfield.h" |
6 | 6 |
7 #import "base/mac/scoped_nsobject.h" | 7 #import "base/mac/scoped_nsobject.h" |
| 8 #include "base/macros.h" |
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "testing/gtest_mac.h" | 11 #include "testing/gtest_mac.h" |
11 #include "testing/platform_test.h" | 12 #include "testing/platform_test.h" |
12 #include "ui/events/test/cocoa_test_event_utils.h" | 13 #include "ui/events/test/cocoa_test_event_utils.h" |
13 | 14 |
14 class AutofillTextFieldTest : public CocoaTest { | 15 class AutofillTextFieldTest : public CocoaTest { |
15 public: | 16 public: |
16 AutofillTextFieldTest() { | 17 AutofillTextFieldTest() { |
17 NSRect frame = NSMakeRect(0, 0, 50, 30); | 18 NSRect frame = NSMakeRect(0, 0, 50, 30); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 69 |
69 // Now test with multiline mode enabled. | 70 // Now test with multiline mode enabled. |
70 [textfield_ setIsMultiline:YES]; | 71 [textfield_ setIsMultiline:YES]; |
71 [textfield_ setStringValue:@""]; | 72 [textfield_ setStringValue:@""]; |
72 [[textfield_ currentEditor] insertText:@"foo"]; | 73 [[textfield_ currentEditor] insertText:@"foo"]; |
73 [[textfield_ currentEditor] | 74 [[textfield_ currentEditor] |
74 keyDown:cocoa_test_event_utils::KeyEventWithCharacter('\n')]; | 75 keyDown:cocoa_test_event_utils::KeyEventWithCharacter('\n')]; |
75 [[textfield_ currentEditor] insertText:@"bar"]; | 76 [[textfield_ currentEditor] insertText:@"bar"]; |
76 EXPECT_NSEQ(@"foo\nbar", [textfield_ stringValue]); | 77 EXPECT_NSEQ(@"foo\nbar", [textfield_ stringValue]); |
77 } | 78 } |
OLD | NEW |