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

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

Issue 112913004: Update some uses of UTF conversions in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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/ui/cocoa/cocoa_profile_test.h" 7 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
8 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" 8 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h"
9 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h" 9 #include "chrome/browser/ui/omnibox/omnibox_popup_model.h"
10 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h" 10 #include "chrome/browser/ui/omnibox/omnibox_popup_view.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 OmniboxViewMac view(&controller, profile(), NULL, field.get()); 152 OmniboxViewMac view(&controller, profile(), NULL, field.get());
153 153
154 // This is deleted by the omnibox view. 154 // This is deleted by the omnibox view.
155 MockOmniboxEditModel* model = 155 MockOmniboxEditModel* model =
156 new MockOmniboxEditModel(&view, &controller, profile()); 156 new MockOmniboxEditModel(&view, &controller, profile());
157 SetModel(&view, model); 157 SetModel(&view, model);
158 158
159 MockOmniboxPopupView popup_view; 159 MockOmniboxPopupView popup_view;
160 OmniboxPopupModel popup_model(&popup_view, model); 160 OmniboxPopupModel popup_model(&popup_view, model);
161 161
162 view.SetUserText(ASCIIToUTF16("Alfred")); 162 view.SetUserText(base::ASCIIToUTF16("Alfred"));
163 EXPECT_EQ("Alfred", UTF16ToUTF8(view.GetText())); 163 EXPECT_EQ("Alfred", base::UTF16ToUTF8(view.GetText()));
164 view.SetGrayTextAutocompletion(ASCIIToUTF16(" Hitchcock")); 164 view.SetGrayTextAutocompletion(base::ASCIIToUTF16(" Hitchcock"));
165 EXPECT_EQ("Alfred", UTF16ToUTF8(view.GetText())); 165 EXPECT_EQ("Alfred", base::UTF16ToUTF8(view.GetText()));
166 EXPECT_EQ(" Hitchcock", UTF16ToUTF8(view.GetGrayTextAutocompletion())); 166 EXPECT_EQ(" Hitchcock", base::UTF16ToUTF8(view.GetGrayTextAutocompletion()));
167 167
168 view.SetUserText(base::string16()); 168 view.SetUserText(base::string16());
169 EXPECT_EQ(base::string16(), view.GetText()); 169 EXPECT_EQ(base::string16(), view.GetText());
170 EXPECT_EQ(base::string16(), view.GetGrayTextAutocompletion()); 170 EXPECT_EQ(base::string16(), view.GetGrayTextAutocompletion());
171 } 171 }
172 172
173 TEST_F(OmniboxViewMacTest, UpDownArrow) { 173 TEST_F(OmniboxViewMacTest, UpDownArrow) {
174 OmniboxViewMac view(NULL, profile(), NULL, NULL); 174 OmniboxViewMac view(NULL, profile(), NULL, NULL);
175 175
176 // This is deleted by the omnibox view. 176 // This is deleted by the omnibox view.
(...skipping 15 matching lines...) Expand all
192 192
193 // With popup open verify that pressing up and down arrow works. 193 // With popup open verify that pressing up and down arrow works.
194 popup_view.set_is_open(true); 194 popup_view.set_is_open(true);
195 model->set_up_or_down_count(0); 195 model->set_up_or_down_count(0);
196 view.OnDoCommandBySelector(@selector(moveDown:)); 196 view.OnDoCommandBySelector(@selector(moveDown:));
197 EXPECT_EQ(1, model->up_or_down_count()); 197 EXPECT_EQ(1, model->up_or_down_count());
198 model->set_up_or_down_count(0); 198 model->set_up_or_down_count(0);
199 view.OnDoCommandBySelector(@selector(moveUp:)); 199 view.OnDoCommandBySelector(@selector(moveUp:));
200 EXPECT_EQ(-1, model->up_or_down_count()); 200 EXPECT_EQ(-1, model->up_or_down_count());
201 } 201 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | chrome/browser/ui/cocoa/profile_menu_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698