| 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 1202a0ed4ec18438f222fe4bd2ae71b69beb04f6..b691d4d3abd57f0cc489c218534eea48eb44caec 100644
|
| --- a/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm
|
| +++ b/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm
|
| @@ -201,12 +201,16 @@ TEST_F(AutocompleteTextFieldCellTest, TextFrame) {
|
| const NSRect bounds([view_ bounds]);
|
| NSRect textFrame;
|
|
|
| + // The cursor frame should stay the same throughout.
|
| + const NSRect cursorFrame([cell textCursorFrameForFrame:bounds]);
|
| +
|
| // At default settings, everything goes to the text area.
|
| textFrame = [cell textFrameForFrame:bounds];
|
| EXPECT_FALSE(NSIsEmptyRect(textFrame));
|
| EXPECT_TRUE(NSContainsRect(bounds, textFrame));
|
| EXPECT_EQ(NSMinX(bounds), NSMinX(textFrame));
|
| EXPECT_EQ(NSMaxX(bounds), NSMaxX(textFrame));
|
| + EXPECT_TRUE(NSEqualRects(cursorFrame, textFrame));
|
|
|
| // Small search hint leaves text frame to left.
|
| [cell setSearchHintString:@"Search hint"];
|
| @@ -214,6 +218,7 @@ TEST_F(AutocompleteTextFieldCellTest, TextFrame) {
|
| EXPECT_FALSE(NSIsEmptyRect(textFrame));
|
| EXPECT_TRUE(NSContainsRect(bounds, textFrame));
|
| EXPECT_LT(NSMaxX(textFrame), NSMaxX(bounds));
|
| + EXPECT_TRUE(NSContainsRect(cursorFrame, textFrame));
|
|
|
| // Save search-hint's frame for future reference.
|
| const CGFloat searchHintMaxX(NSMaxX(textFrame));
|
| @@ -229,6 +234,7 @@ TEST_F(AutocompleteTextFieldCellTest, TextFrame) {
|
| EXPECT_TRUE(NSContainsRect(bounds, textFrame));
|
| EXPECT_LT(NSMaxX(textFrame), NSMaxX(bounds));
|
| EXPECT_LT(NSMaxX(textFrame), searchHintMaxX);
|
| + EXPECT_TRUE(NSContainsRect(cursorFrame, textFrame));
|
|
|
| // Keyword search leaves text area to right.
|
| [cell setKeywordString:@"Search Engine:"];
|
| @@ -238,6 +244,7 @@ TEST_F(AutocompleteTextFieldCellTest, TextFrame) {
|
| EXPECT_GT(NSMinX(textFrame), NSMinX(bounds));
|
| EXPECT_LT(NSMinX(textFrame), searchHintMaxX);
|
| EXPECT_GT(NSMaxX(textFrame), searchHintMaxX);
|
| + EXPECT_TRUE(NSContainsRect(cursorFrame, textFrame));
|
|
|
| // Text frame should take everything over again on reset.
|
| [cell clearKeywordAndHint];
|
| @@ -246,6 +253,7 @@ TEST_F(AutocompleteTextFieldCellTest, TextFrame) {
|
| EXPECT_TRUE(NSContainsRect(bounds, textFrame));
|
| EXPECT_EQ(NSMinX(bounds), NSMinX(textFrame));
|
| EXPECT_EQ(NSMaxX(bounds), NSMaxX(textFrame));
|
| + EXPECT_TRUE(NSContainsRect(cursorFrame, textFrame));
|
| }
|
|
|
| } // namespace
|
|
|