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

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

Issue 2958012: [Mac] Bring back the omnibox globe for an encore. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Rohit's suggestions. 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
diff --git a/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm b/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm
index 6ae696d7f55cec66fdf1a06df07308a82ef31da6..da01dbbd2526278371e7ca82220d68d639000ddc 100644
--- a/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm
+++ b/chrome/browser/cocoa/location_bar/autocomplete_text_field_cell_unittest.mm
@@ -117,11 +117,17 @@ TEST_F(AutocompleteTextFieldCellTest, FocusedDisplay) {
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 @@ TEST_F(AutocompleteTextFieldCellTest, FocusedDisplay) {
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 @@ TEST_F(AutocompleteTextFieldCellTest, FocusedDisplay) {
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