OLD | NEW |
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 "ui/base/text/text_elider.h" | 12 #include "ui/gfx/text_elider.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const float kLargeWidth = 10000; | 16 const float kLargeWidth = 10000; |
17 | 17 |
18 // Returns the length of the run starting at |location| for which | 18 // Returns the length of the run starting at |location| for which |
19 // |attributeName| remains the same. | 19 // |attributeName| remains the same. |
20 NSUInteger RunLengthForAttribute(NSAttributedString* string, | 20 NSUInteger RunLengthForAttribute(NSAttributedString* string, |
21 NSUInteger location, | 21 NSUInteger location, |
22 NSString* attributeName) { | 22 NSString* attributeName) { |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 EXPECT_GT(popup_view.GetTargetBounds().height(), old_height); | 350 EXPECT_GT(popup_view.GetTargetBounds().height(), old_height); |
351 EXPECT_EQ(5, [popup_view.matrix() numberOfRows]); | 351 EXPECT_EQ(5, [popup_view.matrix() numberOfRows]); |
352 | 352 |
353 popup_view.SetResultCount(0); | 353 popup_view.SetResultCount(0); |
354 popup_view.UpdatePopupAppearance(); | 354 popup_view.UpdatePopupAppearance(); |
355 EXPECT_FALSE(popup_view.IsOpen()); | 355 EXPECT_FALSE(popup_view.IsOpen()); |
356 EXPECT_EQ(0, [popup_view.matrix() numberOfRows]); | 356 EXPECT_EQ(0, [popup_view.matrix() numberOfRows]); |
357 } | 357 } |
358 | 358 |
359 } // namespace | 359 } // namespace |
OLD | NEW |