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

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

Issue 3037005: Merge 52385 - [Mac] Bring back the omnibox globe for an encore.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/466/src/
Patch Set: Created 10 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/cocoa/location_bar/location_icon_decoration.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm
===================================================================
--- chrome/browser/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm (revision 52715)
+++ chrome/browser/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm (working copy)
@@ -117,11 +117,17 @@
availableWidth:kWidth];
[view_ display];
- // Load available decorations and try drawing.
+ // Load available decorations and try drawing. To make sure that
+ // they are actually drawn, check that |GetWidthForSpace()| doesn't
+ // indicate that they should be omitted.
+ const CGFloat kVeryWide = 1000.0;
+
SelectedKeywordDecoration selected_keyword_decoration([view_ font]);
selected_keyword_decoration.SetVisible(true);
selected_keyword_decoration.SetKeyword(std::wstring(L"Google"), false);
[cell addLeftDecoration:&selected_keyword_decoration];
+ EXPECT_NE(selected_keyword_decoration.GetWidthForSpace(kVeryWide),
+ LocationBarDecoration::kOmittedWidth);
// TODO(shess): This really wants a |LocationBarViewMac|, but only a
// few methods reference it, so this works well enough. But
@@ -130,6 +136,8 @@
location_icon_decoration.SetVisible(true);
location_icon_decoration.SetImage([NSImage imageNamed:@"NSApplicationIcon"]);
[cell addLeftDecoration:&location_icon_decoration];
+ EXPECT_NE(location_icon_decoration.GetWidthForSpace(kVeryWide),
+ LocationBarDecoration::kOmittedWidth);
EVBubbleDecoration ev_bubble_decoration(&location_icon_decoration,
[view_ font]);
@@ -137,12 +145,16 @@
ev_bubble_decoration.SetImage([NSImage imageNamed:@"NSApplicationIcon"]);
ev_bubble_decoration.SetLabel(@"Application");
[cell addLeftDecoration:&ev_bubble_decoration];
+ EXPECT_NE(ev_bubble_decoration.GetWidthForSpace(kVeryWide),
+ LocationBarDecoration::kOmittedWidth);
// Make sure we're actually calling |DrawInFrame()|.
StrictMock<MockDecoration> mock_decoration;
mock_decoration.SetVisible(true);
[cell addLeftDecoration:&mock_decoration];
EXPECT_CALL(mock_decoration, DrawInFrame(_, _));
+ EXPECT_NE(mock_decoration.GetWidthForSpace(kVeryWide),
+ LocationBarDecoration::kOmittedWidth);
[view_ display];
« no previous file with comments | « no previous file | chrome/browser/cocoa/location_bar/location_icon_decoration.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698