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" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 void SetResultCount(size_t count) { | 27 void SetResultCount(size_t count) { |
28 ACMatches matches; | 28 ACMatches matches; |
29 for (size_t i = 0; i < count; ++i) | 29 for (size_t i = 0; i < count; ++i) |
30 matches.push_back(AutocompleteMatch()); | 30 matches.push_back(AutocompleteMatch()); |
31 result_.Reset(); | 31 result_.Reset(); |
32 result_.AppendMatches(matches); | 32 result_.AppendMatches(matches); |
33 } | 33 } |
34 | 34 |
35 protected: | 35 protected: |
36 virtual const AutocompleteResult& GetResult() const OVERRIDE { | 36 virtual const AutocompleteResult& GetResult() const override { |
37 return result_; | 37 return result_; |
38 } | 38 } |
39 | 39 |
40 private: | 40 private: |
41 AutocompleteResult result_; | 41 AutocompleteResult result_; |
42 }; | 42 }; |
43 | 43 |
44 class OmniboxPopupViewMacTest : public CocoaProfileTest { | 44 class OmniboxPopupViewMacTest : public CocoaProfileTest { |
45 public: | 45 public: |
46 OmniboxPopupViewMacTest() {} | 46 OmniboxPopupViewMacTest() {} |
(...skipping 25 matching lines...) Expand all Loading... |
72 EXPECT_GT(popup_view.GetTargetBounds().height(), old_height); | 72 EXPECT_GT(popup_view.GetTargetBounds().height(), old_height); |
73 EXPECT_EQ(5, [popup_view.matrix() numberOfRows]); | 73 EXPECT_EQ(5, [popup_view.matrix() numberOfRows]); |
74 | 74 |
75 popup_view.SetResultCount(0); | 75 popup_view.SetResultCount(0); |
76 popup_view.UpdatePopupAppearance(); | 76 popup_view.UpdatePopupAppearance(); |
77 EXPECT_FALSE(popup_view.IsOpen()); | 77 EXPECT_FALSE(popup_view.IsOpen()); |
78 EXPECT_EQ(0, [popup_view.matrix() numberOfRows]); | 78 EXPECT_EQ(0, [popup_view.matrix() numberOfRows]); |
79 } | 79 } |
80 | 80 |
81 } // namespace | 81 } // namespace |
OLD | NEW |