OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/autocomplete/autocomplete.h" | 10 #include "chrome/browser/autocomplete/autocomplete.h" |
11 #include "testing/platform_test.h" | 11 #include "testing/platform_test.h" |
12 #include "ui/base/text/text_elider.h" | 12 #include "ui/base/text/text_elider.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 const float kLargeWidth = 10000; | 16 const float kLargeWidth = 10000; |
17 | 17 |
18 class OmniboxPopupViewMacTest : public PlatformTest { | 18 class OmniboxPopupViewMacTest : public PlatformTest { |
19 public: | 19 public: |
20 OmniboxPopupViewMacTest() {} | 20 OmniboxPopupViewMacTest() {} |
21 | 21 |
22 virtual void SetUp() { | 22 virtual void SetUp() { |
23 PlatformTest::SetUp(); | 23 PlatformTest::SetUp(); |
24 | 24 |
25 // These are here because there is no autorelease pool for the | 25 // These are here because there is no autorelease pool for the |
26 // constructor. | 26 // constructor. |
27 color_ = [NSColor blackColor]; | 27 color_ = [NSColor blackColor]; |
28 dimColor_ = [NSColor darkGrayColor]; | 28 dimColor_ = [NSColor darkGrayColor]; |
29 font_ = gfx::Font( | 29 font_ = gfx::Font( |
30 base::SysNSStringToUTF16([[NSFont userFontOfSize:12] fontName]), 12); | 30 base::SysNSStringToUTF8([[NSFont userFontOfSize:12] fontName]), 12); |
31 } | 31 } |
32 | 32 |
33 // Returns the length of the run starting at |location| for which | 33 // Returns the length of the run starting at |location| for which |
34 // |attributeName| remains the same. | 34 // |attributeName| remains the same. |
35 static NSUInteger RunLengthForAttribute(NSAttributedString* string, | 35 static NSUInteger RunLengthForAttribute(NSAttributedString* string, |
36 NSUInteger location, | 36 NSUInteger location, |
37 NSString* attributeName) { | 37 NSString* attributeName) { |
38 const NSRange fullRange = NSMakeRange(0, [string length]); | 38 const NSRange fullRange = NSMakeRange(0, [string length]); |
39 NSRange range; | 39 NSRange range; |
40 [string attribute:attributeName | 40 [string attribute:attributeName |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 // updates the model's selection from the matrix before returning. | 543 // updates the model's selection from the matrix before returning. |
544 // Could possibly test that via -select:. | 544 // Could possibly test that via -select:. |
545 | 545 |
546 // TODO(shess): Test that AutocompleteButtonCell returns the right | 546 // TODO(shess): Test that AutocompleteButtonCell returns the right |
547 // background colors for on, highlighted, and neither. | 547 // background colors for on, highlighted, and neither. |
548 | 548 |
549 // TODO(shess): Test that AutocompleteMatrixTarget can be initialized | 549 // TODO(shess): Test that AutocompleteMatrixTarget can be initialized |
550 // and then sends -select: to the view. | 550 // and then sends -select: to the view. |
551 | 551 |
552 } // namespace | 552 } // namespace |
OLD | NEW |