diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-17 22:23:44 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-17 22:23:44 +0000 |
commit | 018a396fc1650116ecc1df0ad7e5b65ec5ad7bec (patch) | |
tree | 62925bb9a560367a8005a59d734fae3875e6ce6d /chrome/browser/app_controller_mac_unittest.mm | |
parent | e4865191dc123219b81b2905f1a8d23a86ab9573 (diff) | |
download | chromium_src-018a396fc1650116ecc1df0ad7e5b65ec5ad7bec.zip chromium_src-018a396fc1650116ecc1df0ad7e5b65ec5ad7bec.tar.gz chromium_src-018a396fc1650116ecc1df0ad7e5b65ec5ad7bec.tar.bz2 |
Stylistic fixes in the new dock menu code:
* Initialize variables when declared.
* Descriptive name (dock_menu) for the returned value.
* Use a scoped_nsobject in the unit test, not autorelease.
BUG=none
TEST=AppControllerTest.DockMenu
Review URL: http://codereview.chromium.org/200126
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac_unittest.mm')
-rw-r--r-- | chrome/browser/app_controller_mac_unittest.mm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/app_controller_mac_unittest.mm b/chrome/browser/app_controller_mac_unittest.mm index 399e44f..fdc444a 100644 --- a/chrome/browser/app_controller_mac_unittest.mm +++ b/chrome/browser/app_controller_mac_unittest.mm @@ -4,6 +4,7 @@ #import <Cocoa/Cocoa.h> +#include "base/scoped_nsobject.h" #include "chrome/app/chrome_dll_resource.h" #import "chrome/browser/app_controller_mac.h" #include "testing/platform_test.h" @@ -12,7 +13,7 @@ class AppControllerTest : public PlatformTest { }; TEST_F(AppControllerTest, DockMenu) { - AppController* ac = [[[AppController alloc] init] autorelease]; + scoped_nsobject<AppController> ac([[AppController alloc] init]); NSMenu* menu = [ac applicationDockMenu:NSApp]; NSMenuItem* item; @@ -20,7 +21,7 @@ TEST_F(AppControllerTest, DockMenu) { EXPECT_NE(-1, [menu indexOfItemWithTag:IDC_NEW_WINDOW]); EXPECT_NE(-1, [menu indexOfItemWithTag:IDC_NEW_INCOGNITO_WINDOW]); for (item in [menu itemArray]) { - EXPECT_EQ(ac, [item target]); + EXPECT_EQ(ac.get(), [item target]); EXPECT_EQ(@selector(commandDispatch:), [item action]); } } |