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_view_mac.h" | 5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 | 108 |
109 } // namespace | 109 } // namespace |
110 | 110 |
111 class OmniboxViewMacTest : public CocoaProfileTest { | 111 class OmniboxViewMacTest : public CocoaProfileTest { |
112 public: | 112 public: |
113 void SetModel(OmniboxViewMac* view, OmniboxEditModel* model) { | 113 void SetModel(OmniboxViewMac* view, OmniboxEditModel* model) { |
114 view->model_.reset(model); | 114 view->model_.reset(model); |
115 } | 115 } |
116 }; | 116 }; |
117 | 117 |
118 TEST_F(OmniboxViewMacTest, GetFieldFont) { | 118 TEST_F(OmniboxViewMacTest, GetNormalFieldFont) { |
tapted
2016/03/29 20:13:46
Thanks for updating these! But I think we can just
Mikus
2016/03/30 13:58:24
Done.
| |
119 EXPECT_TRUE(OmniboxViewMac::GetFieldFont(gfx::Font::NORMAL)); | 119 EXPECT_TRUE(OmniboxViewMac::GetNormalFieldFont()); |
120 } | |
121 | |
122 TEST_F(OmniboxViewMacTest, GetBoldFieldFont) { | |
123 EXPECT_TRUE(OmniboxViewMac::GetBoldFieldFont()); | |
124 } | |
125 | |
126 TEST_F(OmniboxViewMacTest, GetLargeFont) { | |
127 EXPECT_TRUE(OmniboxViewMac::GetLargeFont()); | |
128 } | |
129 | |
130 TEST_F(OmniboxViewMacTest, GetSmallFont) { | |
131 EXPECT_TRUE(OmniboxViewMac::GetSmallFont()); | |
120 } | 132 } |
121 | 133 |
122 TEST_F(OmniboxViewMacTest, TabToAutocomplete) { | 134 TEST_F(OmniboxViewMacTest, TabToAutocomplete) { |
123 OmniboxViewMac view(NULL, profile(), NULL, NULL); | 135 OmniboxViewMac view(NULL, profile(), NULL, NULL); |
124 | 136 |
125 // This is deleted by the omnibox view. | 137 // This is deleted by the omnibox view. |
126 MockOmniboxEditModel* model = | 138 MockOmniboxEditModel* model = |
127 new MockOmniboxEditModel(&view, NULL, profile()); | 139 new MockOmniboxEditModel(&view, NULL, profile()); |
128 SetModel(&view, model); | 140 SetModel(&view, model); |
129 | 141 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 | 208 |
197 // With popup open verify that pressing up and down arrow works. | 209 // With popup open verify that pressing up and down arrow works. |
198 popup_view.set_is_open(true); | 210 popup_view.set_is_open(true); |
199 model->set_up_or_down_count(0); | 211 model->set_up_or_down_count(0); |
200 view.OnDoCommandBySelector(@selector(moveDown:)); | 212 view.OnDoCommandBySelector(@selector(moveDown:)); |
201 EXPECT_EQ(1, model->up_or_down_count()); | 213 EXPECT_EQ(1, model->up_or_down_count()); |
202 model->set_up_or_down_count(0); | 214 model->set_up_or_down_count(0); |
203 view.OnDoCommandBySelector(@selector(moveUp:)); | 215 view.OnDoCommandBySelector(@selector(moveUp:)); |
204 EXPECT_EQ(-1, model->up_or_down_count()); | 216 EXPECT_EQ(-1, model->up_or_down_count()); |
205 } | 217 } |
OLD | NEW |