| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #include <Carbon/Carbon.h> | 4 #include <Carbon/Carbon.h> | 
| 5 | 5 | 
| 6 #include "base/debug/debugger.h" | 6 #include "base/debug/debugger.h" | 
| 7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" | 
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" | 
| 9 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 9 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 
| 10 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" |  | 
| 11 #include "chrome/browser/ui/cocoa/info_bubble_window.h" | 10 #include "chrome/browser/ui/cocoa/info_bubble_window.h" | 
| 12 #include "chrome/browser/ui/cocoa/run_loop_testing.h" | 11 #include "chrome/browser/ui/cocoa/test/cocoa_test_helper.h" | 
|  | 12 #include "chrome/browser/ui/cocoa/test/run_loop_testing.h" | 
| 13 #include "ui/events/test/cocoa_test_event_utils.h" | 13 #include "ui/events/test/cocoa_test_event_utils.h" | 
| 14 | 14 | 
| 15 // Mock BaseBubbleController to pick up -cancel:, but don't call the designated | 15 // Mock BaseBubbleController to pick up -cancel:, but don't call the designated | 
| 16 // initializer in order to test just InfoBubbleWindow. | 16 // initializer in order to test just InfoBubbleWindow. | 
| 17 @interface InfoBubbleWindowController : BaseBubbleController | 17 @interface InfoBubbleWindowController : BaseBubbleController | 
| 18 @end | 18 @end | 
| 19 | 19 | 
| 20 @implementation InfoBubbleWindowController | 20 @implementation InfoBubbleWindowController | 
| 21 - (IBAction)cancel:(id)sender { | 21 - (IBAction)cancel:(id)sender { | 
| 22   [self close]; | 22   [self close]; | 
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 71 | 71 | 
| 72 TEST_F(InfoBubbleWindowTest, CommandPeriodCloses) { | 72 TEST_F(InfoBubbleWindowTest, CommandPeriodCloses) { | 
| 73   [controller_ showWindow:nil]; | 73   [controller_ showWindow:nil]; | 
| 74   EXPECT_TRUE([window_ isVisible]); | 74   EXPECT_TRUE([window_ isVisible]); | 
| 75 | 75 | 
| 76   [window_ performKeyEquivalent:cocoa_test_event_utils::KeyEventWithKeyCode( | 76   [window_ performKeyEquivalent:cocoa_test_event_utils::KeyEventWithKeyCode( | 
| 77                                     kVK_ANSI_Period, '.', NSKeyDown, | 77                                     kVK_ANSI_Period, '.', NSKeyDown, | 
| 78                                     NSCommandKeyMask)]; | 78                                     NSCommandKeyMask)]; | 
| 79   EXPECT_FALSE([window_ isVisible]); | 79   EXPECT_FALSE([window_ isVisible]); | 
| 80 } | 80 } | 
| OLD | NEW | 
|---|