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