Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm

Issue 24733003: Update defaults for InstantExtended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up test. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698