| 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 "chrome/browser/search/search.h" | 7 #include "chrome/browser/search/search.h" |
| 8 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 8 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 9 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 9 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
| 10 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" | 10 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void SetModel(OmniboxViewMac* view, OmniboxEditModel* model) { | 116 void SetModel(OmniboxViewMac* view, OmniboxEditModel* model) { |
| 117 view->model_.reset(model); | 117 view->model_.reset(model); |
| 118 } | 118 } |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 TEST_F(OmniboxViewMacTest, GetFieldFont) { | 121 TEST_F(OmniboxViewMacTest, GetFieldFont) { |
| 122 EXPECT_TRUE(OmniboxViewMac::GetFieldFont()); | 122 EXPECT_TRUE(OmniboxViewMac::GetFieldFont()); |
| 123 } | 123 } |
| 124 | 124 |
| 125 TEST_F(OmniboxViewMacTest, TabToAutocomplete) { | 125 TEST_F(OmniboxViewMacTest, TabToAutocomplete) { |
| 126 chrome::EnableInstantExtendedAPIForTesting(); | 126 chrome::EnableQueryExtractionForTesting(); |
| 127 OmniboxViewMac view(NULL, profile(), NULL, NULL); | 127 OmniboxViewMac view(NULL, profile(), NULL, NULL); |
| 128 | 128 |
| 129 // This is deleted by the omnibox view. | 129 // This is deleted by the omnibox view. |
| 130 MockOmniboxEditModel* model = | 130 MockOmniboxEditModel* model = |
| 131 new MockOmniboxEditModel(&view, NULL, profile()); | 131 new MockOmniboxEditModel(&view, NULL, profile()); |
| 132 SetModel(&view, model); | 132 SetModel(&view, model); |
| 133 | 133 |
| 134 MockOmniboxPopupView popup_view; | 134 MockOmniboxPopupView popup_view; |
| 135 OmniboxPopupModel popup_model(&popup_view, model); | 135 OmniboxPopupModel popup_model(&popup_view, model); |
| 136 | 136 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 // With popup open verify that pressing up and down arrow works. | 201 // With popup open verify that pressing up and down arrow works. |
| 202 popup_view.set_is_open(true); | 202 popup_view.set_is_open(true); |
| 203 model->set_up_or_down_count(0); | 203 model->set_up_or_down_count(0); |
| 204 view.OnDoCommandBySelector(@selector(moveDown:)); | 204 view.OnDoCommandBySelector(@selector(moveDown:)); |
| 205 EXPECT_EQ(1, model->up_or_down_count()); | 205 EXPECT_EQ(1, model->up_or_down_count()); |
| 206 model->set_up_or_down_count(0); | 206 model->set_up_or_down_count(0); |
| 207 view.OnDoCommandBySelector(@selector(moveUp:)); | 207 view.OnDoCommandBySelector(@selector(moveUp:)); |
| 208 EXPECT_EQ(-1, model->up_or_down_count()); | 208 EXPECT_EQ(-1, model->up_or_down_count()); |
| 209 } | 209 } |
| OLD | NEW |