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

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

Issue 1581011: [Mac] Magnifying glass in keyword-search bubble. (Closed)
Patch Set: Present for Rohit. Created 10 years, 9 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_cell_unittest.mm
diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm b/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm
index 65241db81f5f773ab4af44ca823ec6f0b12e756d..00e7b62eafee98592a955691f85544758e7b74c3 100644
--- a/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm
@@ -443,11 +443,22 @@ TEST_F(AutocompleteTextFieldCellTest, UsesPartialKeywordIfNarrow) {
const NSString* kFullString = @"Search Engine:";
const NSString* kPartialString = @"Search Eng:";
- // Wide width chooses the full string.
+ // Wide width chooses the full string, including an image on the
+ // left.
[cell setKeywordString:kFullString
partialString:kPartialString
availableWidth:kWidth];
EXPECT_TRUE([cell keywordString]);
+ EXPECT_TRUE([[[cell keywordString] string] hasSuffix:kFullString]);
+ EXPECT_TRUE([[cell keywordString] containsAttachments]);
+
+ // If not enough space to include the image, uses exactly the full
+ // string.
+ CGFloat allWidth = [[cell keywordString] size].width;
+ [cell setKeywordString:kFullString
+ partialString:kPartialString
+ availableWidth:allWidth - 5.0];
+ EXPECT_TRUE([cell keywordString]);
EXPECT_TRUE([[[cell keywordString] string] isEqualToString:kFullString]);
// Narrow width chooses the partial string.
« no previous file with comments | « chrome/browser/cocoa/autocomplete_text_field_cell.mm ('k') | chrome/browser/cocoa/location_bar_view_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698