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-11 21:20:05 +0000
committersgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 21:20:05 +0000
commit8e304832e919812661960afbee292892788b628f (patch)
tree9ae0d56f8c3177bbfdcee3330c11172fc9243483 /chrome/browser/app_controller_mac_unittest.mm
parentb7e273f8fc7448ecd476ecdb563a3566eb9bce1e (diff)
downloadchromium_src-8e304832e919812661960afbee292892788b628f.zip
chromium_src-8e304832e919812661960afbee292892788b628f.tar.gz
chromium_src-8e304832e919812661960afbee292892788b628f.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=none TEST=none Review URL: http://codereview.chromium.org/199031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26016 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..49067a0
--- /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];
+ 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]);
+ }
+}