Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: chrome/browser/cocoa/autocomplete_text_field_unittest.mm

Issue 222020: [Mac] Show the page info window after clicking the security icon in the URL bar (Closed)
Patch Set: Unit tests Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698