Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "chrome/app/chrome_dll_resource.h" | 7 #include "chrome/app/chrome_dll_resource.h" |
| 8 #import "chrome/browser/app_controller_mac.h" | 8 #import "chrome/browser/app_controller_mac.h" |
| 9 #include "testing/platform_test.h" | 9 #include "testing/platform_test.h" |
| 10 | 10 |
| 11 class AppControllerTest : public PlatformTest { | 11 class AppControllerTest : public PlatformTest { |
| 12 }; | 12 }; |
| 13 | 13 |
| 14 TEST_F(AppControllerTest, DockMenu) { | 14 TEST_F(AppControllerTest, DockMenu) { |
| 15 AppController* ac = [[AppController alloc] init]; | 15 AppController* ac = [[[AppController alloc] init] autorelease]; |
|
pink (ping after 24hrs)
2009/09/14 19:13:03
again, this should be a scoped_nsobject.
| |
| 16 NSMenu* menu = [ac applicationDockMenu:NSApp]; | 16 NSMenu* menu = [ac applicationDockMenu:NSApp]; |
| 17 NSMenuItem* item; | 17 NSMenuItem* item; |
| 18 | 18 |
| 19 EXPECT_TRUE(menu); | 19 EXPECT_TRUE(menu); |
| 20 EXPECT_NE(-1, [menu indexOfItemWithTag:IDC_NEW_WINDOW]); | 20 EXPECT_NE(-1, [menu indexOfItemWithTag:IDC_NEW_WINDOW]); |
| 21 EXPECT_NE(-1, [menu indexOfItemWithTag:IDC_NEW_INCOGNITO_WINDOW]); | 21 EXPECT_NE(-1, [menu indexOfItemWithTag:IDC_NEW_INCOGNITO_WINDOW]); |
| 22 for (item in [menu itemArray]) { | 22 for (item in [menu itemArray]) { |
| 23 EXPECT_EQ(ac, [item target]); | 23 EXPECT_EQ(ac, [item target]); |
| 24 EXPECT_EQ(@selector(commandDispatch:), [item action]); | 24 EXPECT_EQ(@selector(commandDispatch:), [item action]); |
| 25 } | 25 } |
| 26 } | 26 } |
| OLD | NEW |