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

Side by Side Diff: chrome/browser/cocoa/find_bar_text_field_cell_unittest.mm

Issue 2876002: Mac/clang: First pass over unit_tests (Closed)
Patch Set: '' Created 10 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/scoped_nsobject.h" 7 #include "base/scoped_nsobject.h"
8 #import "chrome/browser/cocoa/find_bar_text_field_cell.h" 8 #import "chrome/browser/cocoa/find_bar_text_field_cell.h"
9 #import "chrome/browser/cocoa/cocoa_test_helper.h" 9 #import "chrome/browser/cocoa/cocoa_test_helper.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 EXPECT_TRUE(NSEqualRects(cursorFrame, textFrame)); 115 EXPECT_TRUE(NSEqualRects(cursorFrame, textFrame));
116 116
117 } 117 }
118 118
119 // The editor frame should be slightly inset from the text frame. 119 // The editor frame should be slightly inset from the text frame.
120 TEST_F(FindBarTextFieldCellTest, DrawingRectForBounds) { 120 TEST_F(FindBarTextFieldCellTest, DrawingRectForBounds) {
121 const NSRect bounds = [view_ bounds]; 121 const NSRect bounds = [view_ bounds];
122 NSRect textFrame = [cell_ textFrameForFrame:bounds]; 122 NSRect textFrame = [cell_ textFrameForFrame:bounds];
123 NSRect drawingRect = [cell_ drawingRectForBounds:bounds]; 123 NSRect drawingRect = [cell_ drawingRectForBounds:bounds];
124 124
125 // Save the starting frame for after clear.
126 const NSRect originalDrawingRect(drawingRect);
127
128 EXPECT_FALSE(NSIsEmptyRect(drawingRect)); 125 EXPECT_FALSE(NSIsEmptyRect(drawingRect));
129 EXPECT_TRUE(NSContainsRect(textFrame, NSInsetRect(drawingRect, 1, 1))); 126 EXPECT_TRUE(NSContainsRect(textFrame, NSInsetRect(drawingRect, 1, 1)));
130 127
131 [cell_ setActiveMatch:4 of:5]; 128 [cell_ setActiveMatch:4 of:5];
132 textFrame = [cell_ textFrameForFrame:bounds]; 129 textFrame = [cell_ textFrameForFrame:bounds];
133 drawingRect = [cell_ drawingRectForBounds:bounds]; 130 drawingRect = [cell_ drawingRectForBounds:bounds];
134 EXPECT_FALSE(NSIsEmptyRect(drawingRect)); 131 EXPECT_FALSE(NSIsEmptyRect(drawingRect));
135 EXPECT_TRUE(NSContainsRect(textFrame, NSInsetRect(drawingRect, 1, 1))); 132 EXPECT_TRUE(NSContainsRect(textFrame, NSInsetRect(drawingRect, 1, 1)));
136 } 133 }
137 134
138 } // namespace 135 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698