diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 16:23:56 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-14 16:23:56 +0000 |
commit | b1d08c68cf8cc377fa6250642cf668dc67bda05d (patch) | |
tree | 32645963281688647dca79fd52951f5e05a5b0bd /chrome/browser/cocoa/menu_controller_unittest.mm | |
parent | cd4bcde2bc5243828845ad57dae062648ece19d3 (diff) | |
download | chromium_src-b1d08c68cf8cc377fa6250642cf668dc67bda05d.zip chromium_src-b1d08c68cf8cc377fa6250642cf668dc67bda05d.tar.gz chromium_src-b1d08c68cf8cc377fa6250642cf668dc67bda05d.tar.bz2 |
Convert some obvious wide strings in browser/cocoa.
BUG=23581
TEST=builds and passes tests
Review URL: http://codereview.chromium.org/3124023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/menu_controller_unittest.mm')
-rw-r--r-- | chrome/browser/cocoa/menu_controller_unittest.mm | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/chrome/browser/cocoa/menu_controller_unittest.mm b/chrome/browser/cocoa/menu_controller_unittest.mm index de0362a..448fa80 100644 --- a/chrome/browser/cocoa/menu_controller_unittest.mm +++ b/chrome/browser/cocoa/menu_controller_unittest.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -45,12 +45,12 @@ TEST_F(MenuControllerTest, EmptyMenu) { TEST_F(MenuControllerTest, BasicCreation) { Delegate delegate; menus::SimpleMenuModel model(&delegate); - model.AddItem(1, WideToUTF16(L"one")); - model.AddItem(2, WideToUTF16(L"two")); - model.AddItem(3, WideToUTF16(L"three")); + model.AddItem(1, ASCIIToUTF16("one")); + model.AddItem(2, ASCIIToUTF16("two")); + model.AddItem(3, ASCIIToUTF16("three")); model.AddSeparator(); - model.AddItem(4, WideToUTF16(L"four")); - model.AddItem(5, WideToUTF16(L"five")); + model.AddItem(4, ASCIIToUTF16("four")); + model.AddItem(5, ASCIIToUTF16("five")); scoped_nsobject<MenuController> menu( [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); @@ -60,7 +60,7 @@ TEST_F(MenuControllerTest, BasicCreation) { // element. NSMenuItem* itemTwo = [[menu menu] itemAtIndex:2]; NSString* title = [itemTwo title]; - EXPECT_EQ(WideToUTF16(L"three"), base::SysNSStringToUTF16(title)); + EXPECT_EQ(ASCIIToUTF16("three"), base::SysNSStringToUTF16(title)); EXPECT_EQ([itemTwo tag], 2); EXPECT_EQ([[itemTwo representedObject] pointerValue], &model); @@ -70,13 +70,13 @@ TEST_F(MenuControllerTest, BasicCreation) { TEST_F(MenuControllerTest, Submenus) { Delegate delegate; menus::SimpleMenuModel model(&delegate); - model.AddItem(1, WideToUTF16(L"one")); + model.AddItem(1, ASCIIToUTF16("one")); menus::SimpleMenuModel submodel(&delegate); - submodel.AddItem(2, WideToUTF16(L"sub-one")); - submodel.AddItem(3, WideToUTF16(L"sub-two")); - submodel.AddItem(4, WideToUTF16(L"sub-three")); + submodel.AddItem(2, ASCIIToUTF16("sub-one")); + submodel.AddItem(3, ASCIIToUTF16("sub-two")); + submodel.AddItem(4, ASCIIToUTF16("sub-three")); model.AddSubMenuWithStringId(5, IDS_ZOOM_MENU, &submodel); - model.AddItem(6, WideToUTF16(L"three")); + model.AddItem(6, ASCIIToUTF16("three")); scoped_nsobject<MenuController> menu( [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); @@ -91,7 +91,7 @@ TEST_F(MenuControllerTest, Submenus) { // represented object and the proper tag. NSMenuItem* submenuItem = [submenu itemAtIndex:1]; NSString* title = [submenuItem title]; - EXPECT_EQ(WideToUTF16(L"sub-two"), base::SysNSStringToUTF16(title)); + EXPECT_EQ(ASCIIToUTF16("sub-two"), base::SysNSStringToUTF16(title)); EXPECT_EQ([submenuItem tag], 1); EXPECT_EQ([[submenuItem representedObject] pointerValue], &submodel); @@ -99,7 +99,7 @@ TEST_F(MenuControllerTest, Submenus) { // object is back to the top model. NSMenuItem* item = [[menu menu] itemAtIndex:2]; title = [item title]; - EXPECT_EQ(WideToUTF16(L"three"), base::SysNSStringToUTF16(title)); + EXPECT_EQ(ASCIIToUTF16("three"), base::SysNSStringToUTF16(title)); EXPECT_EQ([item tag], 2); EXPECT_EQ([[item representedObject] pointerValue], &model); } @@ -107,7 +107,7 @@ TEST_F(MenuControllerTest, Submenus) { TEST_F(MenuControllerTest, EmptySubmenu) { Delegate delegate; menus::SimpleMenuModel model(&delegate); - model.AddItem(1, WideToUTF16(L"one")); + model.AddItem(1, ASCIIToUTF16("one")); menus::SimpleMenuModel submodel(&delegate); model.AddSubMenuWithStringId(2, IDS_ZOOM_MENU, &submodel); @@ -119,9 +119,9 @@ TEST_F(MenuControllerTest, EmptySubmenu) { TEST_F(MenuControllerTest, PopUpButton) { Delegate delegate; menus::SimpleMenuModel model(&delegate); - model.AddItem(1, WideToUTF16(L"one")); - model.AddItem(2, WideToUTF16(L"two")); - model.AddItem(3, WideToUTF16(L"three")); + model.AddItem(1, ASCIIToUTF16("one")); + model.AddItem(2, ASCIIToUTF16("two")); + model.AddItem(3, ASCIIToUTF16("three")); // Menu should have an extra item inserted at position 0 that has an empty // title. @@ -139,7 +139,7 @@ TEST_F(MenuControllerTest, PopUpButton) { TEST_F(MenuControllerTest, Execute) { Delegate delegate; menus::SimpleMenuModel model(&delegate); - model.AddItem(1, WideToUTF16(L"one")); + model.AddItem(1, ASCIIToUTF16("one")); scoped_nsobject<MenuController> menu( [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); EXPECT_EQ([[menu menu] numberOfItems], 1); @@ -163,10 +163,10 @@ void Validate(MenuController* controller, NSMenu* menu) { TEST_F(MenuControllerTest, Validate) { Delegate delegate; menus::SimpleMenuModel model(&delegate); - model.AddItem(1, WideToUTF16(L"one")); - model.AddItem(2, WideToUTF16(L"two")); + model.AddItem(1, ASCIIToUTF16("one")); + model.AddItem(2, ASCIIToUTF16("two")); menus::SimpleMenuModel submodel(&delegate); - submodel.AddItem(2, WideToUTF16(L"sub-one")); + submodel.AddItem(2, ASCIIToUTF16("sub-one")); model.AddSubMenuWithStringId(3, IDS_ZOOM_MENU, &submodel); scoped_nsobject<MenuController> menu( @@ -179,9 +179,9 @@ TEST_F(MenuControllerTest, Validate) { TEST_F(MenuControllerTest, DefaultInitializer) { Delegate delegate; menus::SimpleMenuModel model(&delegate); - model.AddItem(1, WideToUTF16(L"one")); - model.AddItem(2, WideToUTF16(L"two")); - model.AddItem(3, WideToUTF16(L"three")); + model.AddItem(1, ASCIIToUTF16("one")); + model.AddItem(2, ASCIIToUTF16("two")); + model.AddItem(3, ASCIIToUTF16("three")); scoped_nsobject<MenuController> menu([[MenuController alloc] init]); EXPECT_FALSE([menu menu]); @@ -192,6 +192,6 @@ TEST_F(MenuControllerTest, DefaultInitializer) { EXPECT_EQ(3, [[menu menu] numberOfItems]); // Check immutability. - model.AddItem(4, WideToUTF16(L"four")); + model.AddItem(4, ASCIIToUTF16("four")); EXPECT_EQ(3, [[menu menu] numberOfItems]); } |