Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cocoa/location_bar/autocomplete_text_field_editor.h" | 5 #import "chrome/browser/cocoa/location_bar/autocomplete_text_field_editor.h" |
| 6 | 6 |
| 7 #include "base/scoped_nsobject.h" | 7 #include "base/scoped_nsobject.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" // IDC_* | 10 #include "chrome/app/chrome_dll_resource.h" // IDC_* |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 | 57 |
| 58 EXPECT_TRUE(editor_); | 58 EXPECT_TRUE(editor_); |
| 59 EXPECT_TRUE([editor_ isKindOfClass:[AutocompleteTextFieldEditor class]]); | 59 EXPECT_TRUE([editor_ isKindOfClass:[AutocompleteTextFieldEditor class]]); |
| 60 } | 60 } |
| 61 | 61 |
| 62 AutocompleteTextFieldEditor* editor_; | 62 AutocompleteTextFieldEditor* editor_; |
| 63 AutocompleteTextField* field_; | 63 AutocompleteTextField* field_; |
| 64 scoped_nsobject<AutocompleteTextFieldWindowTestDelegate> window_delegate_; | 64 scoped_nsobject<AutocompleteTextFieldWindowTestDelegate> window_delegate_; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 // Disabled because it crashes sometimes. http://crbug.com/49522 | |
| 68 // Can't rename DISABLED_ because the TEST_VIEW macro prepends. http://crbug.com /53621 | |
|
Nico
2010/08/27 21:01:35
> 80 cols
| |
| 69 #if 0 | |
| 67 TEST_VIEW(AutocompleteTextFieldEditorTest, field_); | 70 TEST_VIEW(AutocompleteTextFieldEditorTest, field_); |
| 71 #endif | |
| 68 | 72 |
| 69 // Test that control characters are stripped from insertions. | 73 // Test that control characters are stripped from insertions. |
| 70 TEST_F(AutocompleteTextFieldEditorTest, InsertStripsControlChars) { | 74 TEST_F(AutocompleteTextFieldEditorTest, InsertStripsControlChars) { |
| 71 // Sets a string in the field. | 75 // Sets a string in the field. |
| 72 NSString* test_string = @"astring"; | 76 NSString* test_string = @"astring"; |
| 73 [field_ setStringValue:test_string]; | 77 [field_ setStringValue:test_string]; |
| 74 [editor_ selectAll:nil]; | 78 [editor_ selectAll:nil]; |
| 75 | 79 |
| 76 [editor_ insertText:@"t"]; | 80 [editor_ insertText:@"t"]; |
| 77 EXPECT_NSEQ(@"t", [field_ stringValue]); | 81 EXPECT_NSEQ(@"t", [field_ stringValue]); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 NSArray* items = [menu itemArray]; | 292 NSArray* items = [menu itemArray]; |
| 289 ASSERT_EQ([items count], 3U); | 293 ASSERT_EQ([items count], 3U); |
| 290 // TODO(shess): Check the titles, too? | 294 // TODO(shess): Check the titles, too? |
| 291 NSUInteger i = 0; // Use an index to make future changes easier. | 295 NSUInteger i = 0; // Use an index to make future changes easier. |
| 292 EXPECT_EQ([[items objectAtIndex:i++] action], @selector(cut:)); | 296 EXPECT_EQ([[items objectAtIndex:i++] action], @selector(cut:)); |
| 293 EXPECT_EQ([[items objectAtIndex:i++] action], @selector(copy:)); | 297 EXPECT_EQ([[items objectAtIndex:i++] action], @selector(copy:)); |
| 294 EXPECT_EQ([[items objectAtIndex:i++] action], @selector(paste:)); | 298 EXPECT_EQ([[items objectAtIndex:i++] action], @selector(paste:)); |
| 295 } | 299 } |
| 296 | 300 |
| 297 } // namespace | 301 } // namespace |
| OLD | NEW |