Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7001)

Unified Diff: chrome/browser/ui/cocoa/chrome_browser_window_unittest.mm

Issue 9230011: Better fix for Lion dictionary popover cmd-W bug. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/chrome_browser_window.mm ('k') | chrome/browser/ui/cocoa/fullscreen_window.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/chrome_browser_window_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/chrome_browser_window_unittest.mm (revision 117895)
+++ chrome/browser/ui/cocoa/chrome_browser_window_unittest.mm (working copy)
@@ -12,23 +12,6 @@
#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
-// An NSWindowDelegate that implements -commandDispatch:.
-@interface TestDelegateWithCommandDispatch : NSObject {
-}
-- (void)commandDispatch:(id)sender;
-@end
-@implementation TestDelegateWithCommandDispatch
-- (void)commandDispatch:(id)sender {
-}
-@end
-
-// An NSWindowDelegate that doesn't implement -commandDispatch:.
-@interface TestDelegateWithoutCommandDispatch : NSObject {
-}
-@end
-@implementation TestDelegateWithoutCommandDispatch
-@end
-
class ChromeBrowserWindowTest : public CocoaTest {
public:
virtual void SetUp() {
@@ -62,43 +45,3 @@
[window_ display];
}
-// Tests routing of -performClose:.
-TEST_F(ChromeBrowserWindowTest, PerformCloseTest) {
- scoped_nsobject<NSMenuItem> zoom_item(
- [[NSMenuItem alloc] initWithTitle:@"Zoom"
- action:@selector(performZoom:)
- keyEquivalent:@""]);
- scoped_nsobject<NSMenuItem> close_item(
- [[NSMenuItem alloc] initWithTitle:@"Close"
- action:@selector(performClose:)
- keyEquivalent:@""]);
- scoped_nsobject<NSMenuItem> close_tab_item(
- [[NSMenuItem alloc] initWithTitle:@"Close Tab"
- action:@selector(performClose:)
- keyEquivalent:@""]);
- [close_tab_item setTag:IDC_CLOSE_TAB];
-
- scoped_nsobject<id> delegate1(
- [[TestDelegateWithCommandDispatch alloc] init]);
- scoped_nsobject<id> delegate2(
- [[TestDelegateWithoutCommandDispatch alloc] init]);
-
- struct {
- id delegate;
- id sender;
- BOOL should_route;
- } cases[] = {
- { delegate1, delegate1, NO },
- { delegate1, window_, NO },
- { delegate1, zoom_item, NO },
- { delegate1, close_item, NO },
- { delegate1, close_tab_item, YES },
- { delegate2, close_tab_item, NO },
- };
-
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
- [window_ setDelegate:cases[i].delegate];
- EXPECT_EQ(cases[i].should_route,
- [window_ performCloseShouldRouteToCommandDispatch:cases[i].sender]);
- }
-}
« no previous file with comments | « chrome/browser/ui/cocoa/chrome_browser_window.mm ('k') | chrome/browser/ui/cocoa/fullscreen_window.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698