summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac_unittest.mm
diff options
context:
space:
mode:
authorsgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 18:14:46 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-14 18:14:46 +0000
commit288bfcd3e84eb6747f697578e13b1ad4c81fd727 (patch)
tree6341947b46c8ec5d9ddfa18c65635ffef45fe92c /chrome/browser/app_controller_mac_unittest.mm
parent3d39b825dbb27bfd842db44c0fac521e0d06febb (diff)
downloadchromium_src-288bfcd3e84eb6747f697578e13b1ad4c81fd727.zip
chromium_src-288bfcd3e84eb6747f697578e13b1ad4c81fd727.tar.gz
chromium_src-288bfcd3e84eb6747f697578e13b1ad4c81fd727.tar.bz2
Add "New Window" and "New Incognito Window" items to the Dock Menu.
Add a unit test module for AppController with a simple DockMenu test. BUG=21175 TEST=AppControllerTest.DockMenu Review URL: http://codereview.chromium.org/196103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26124 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac_unittest.mm')
-rw-r--r--chrome/browser/app_controller_mac_unittest.mm26
1 files changed, 26 insertions, 0 deletions
diff --git a/chrome/browser/app_controller_mac_unittest.mm b/chrome/browser/app_controller_mac_unittest.mm
new file mode 100644
index 0000000..399e44f
--- /dev/null
+++ b/chrome/browser/app_controller_mac_unittest.mm
@@ -0,0 +1,26 @@
+// Copyright (c) 2009 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.
+
+#import <Cocoa/Cocoa.h>
+
+#include "chrome/app/chrome_dll_resource.h"
+#import "chrome/browser/app_controller_mac.h"
+#include "testing/platform_test.h"
+
+class AppControllerTest : public PlatformTest {
+};
+
+TEST_F(AppControllerTest, DockMenu) {
+ AppController* ac = [[[AppController alloc] init] autorelease];
+ NSMenu* menu = [ac applicationDockMenu:NSApp];
+ NSMenuItem* item;
+
+ EXPECT_TRUE(menu);
+ 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(@selector(commandDispatch:), [item action]);
+ }
+}