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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm

Issue 24579003: Clean up remaining unused globals (on mac). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: staticmedia Created 7 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h" 5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
11 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" 11 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h"
12 #include "chrome/test/base/testing_profile.h" 12 #include "chrome/test/base/testing_profile.h"
13 #include "ui/gfx/rect.h" 13 #include "ui/gfx/rect.h"
14 #include "ui/gfx/text_elider.h" 14 #include "ui/gfx/text_elider.h"
15 15
16 namespace { 16 namespace {
17 17
18 const float kLargeWidth = 10000;
19
20 // Returns the length of the run starting at |location| for which 18 // Returns the length of the run starting at |location| for which
21 // |attributeName| remains the same. 19 // |attributeName| remains the same.
22 NSUInteger RunLengthForAttribute(NSAttributedString* string, 20 NSUInteger RunLengthForAttribute(NSAttributedString* string,
23 NSUInteger location, 21 NSUInteger location,
24 NSString* attributeName) { 22 NSString* attributeName) {
25 const NSRange full_range = NSMakeRange(0, [string length]); 23 const NSRange full_range = NSMakeRange(0, [string length]);
26 NSRange range; 24 NSRange range;
27 [string attribute:attributeName 25 [string attribute:attributeName
28 atIndex:location longestEffectiveRange:&range inRange:full_range]; 26 atIndex:location longestEffectiveRange:&range inRange:full_range];
29 27
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 EXPECT_GT(popup_view.GetTargetBounds().height(), old_height); 350 EXPECT_GT(popup_view.GetTargetBounds().height(), old_height);
353 EXPECT_EQ(5, [popup_view.matrix() numberOfRows]); 351 EXPECT_EQ(5, [popup_view.matrix() numberOfRows]);
354 352
355 popup_view.SetResultCount(0); 353 popup_view.SetResultCount(0);
356 popup_view.UpdatePopupAppearance(); 354 popup_view.UpdatePopupAppearance();
357 EXPECT_FALSE(popup_view.IsOpen()); 355 EXPECT_FALSE(popup_view.IsOpen());
358 EXPECT_EQ(0, [popup_view.matrix() numberOfRows]); 356 EXPECT_EQ(0, [popup_view.matrix() numberOfRows]);
359 } 357 }
360 358
361 } // namespace 359 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698