Chromium Code Reviews| Index: chrome/browser/cocoa/autocomplete_text_field_unittest.mm |
| diff --git a/chrome/browser/cocoa/autocomplete_text_field_unittest.mm b/chrome/browser/cocoa/autocomplete_text_field_unittest.mm |
| index 41cbe214b6849e0098cd7f26f4ea0d2f96d72924..d5d1b9f0034ddf9c77e10ad4cd3792d94e729b10 100644 |
| --- a/chrome/browser/cocoa/autocomplete_text_field_unittest.mm |
| +++ b/chrome/browser/cocoa/autocomplete_text_field_unittest.mm |
| @@ -517,6 +517,18 @@ TEST_F(AutocompleteTextFieldTest, TripleClickSelectsAll) { |
| EXPECT_EQ(selectedRange.length, [[field_ stringValue] length]); |
| } |
| +TEST_F(AutocompleteTextFieldTest, SecurityIconMouseDown) { |
| + AutocompleteTextFieldCell* cell = [field_ autocompleteTextFieldCell]; |
| + scoped_nsobject<NSImage> hintIcon( |
| + [[NSImage alloc] initWithSize:NSMakeSize(20, 20)]); |
| + [cell setHintIcon:hintIcon.get()]; |
| + NSRect iconFrame([cell hintImageFrameForFrame:[field_ bounds]]); |
| + NSPoint location(NSMakePoint(NSMidX(iconFrame), NSMidY(iconFrame))); |
| + NSEvent* event(Event(field_, location, NSLeftMouseDown, 1)); |
| + EXPECT_CALL(field_observer_, OnSecurityIconClicked()); |
| + [field_ mouseDown:event]; |
|
Scott Hess - ex-Googler
2009/10/06 20:30:54
So Awesome.
|
| +} |
| + |
| } // namespace |
| @implementation AutocompleteTextFieldTestDelegate |