1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #import <Cocoa/Cocoa.h>
7 #include "base/memory/scoped_nsobject.h"
8 #include "chrome/app/chrome_command_ids.h"
9 #import "chrome/browser/app_controller_mac.h"
10 #include "testing/platform_test.h"
12 class AppControllerTest : public PlatformTest {
15 TEST_F(AppControllerTest, DockMenu) {
16 scoped_nsobject<AppController> ac([[AppController alloc] init]);
17 NSMenu* menu = [ac applicationDockMenu:NSApp];
21 EXPECT_NE(-1, [menu indexOfItemWithTag:IDC_NEW_WINDOW]);
22 EXPECT_NE(-1, [menu indexOfItemWithTag:IDC_NEW_INCOGNITO_WINDOW]);
23 for (item in [menu itemArray]) {
24 EXPECT_EQ(ac.get(), [item target]);
25 EXPECT_EQ(@selector(commandFromDock:), [item action]);