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

Side by Side Diff: chrome/browser/ui/cocoa/info_bubble_window_unittest.mm

Issue 1894903003: Mac: Fix SDK 10.11 Compile errors after clang roll in r387792 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mock BaseBubbleController Created 4 years, 8 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 unified diff | Download patch
OLDNEW
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 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h" 10 #include "chrome/browser/ui/cocoa/cocoa_test_helper.h"
10 #include "chrome/browser/ui/cocoa/info_bubble_window.h" 11 #include "chrome/browser/ui/cocoa/info_bubble_window.h"
11 #include "chrome/browser/ui/cocoa/run_loop_testing.h" 12 #include "chrome/browser/ui/cocoa/run_loop_testing.h"
12 #include "ui/events/test/cocoa_test_event_utils.h" 13 #include "ui/events/test/cocoa_test_event_utils.h"
13 14
14 @interface InfoBubbleWindowController : NSWindowController 15 // Mock BaseBubbleController to pick up -cancel:, but don't call the designated
15 - (IBAction)cancel:(id)sender; 16 // initializer in order to test just InfoBubbleWindow.
17 @interface InfoBubbleWindowController : BaseBubbleController
16 @end 18 @end
17 19
18 @implementation InfoBubbleWindowController 20 @implementation InfoBubbleWindowController
19 - (IBAction)cancel:(id)sender { 21 - (IBAction)cancel:(id)sender {
20 [self close]; 22 [self close];
21 } 23 }
22 @end 24 @end
23 25
24 class InfoBubbleWindowTest : public CocoaTest { 26 class InfoBubbleWindowTest : public CocoaTest {
25 public: 27 public:
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 71
70 TEST_F(InfoBubbleWindowTest, CommandPeriodCloses) { 72 TEST_F(InfoBubbleWindowTest, CommandPeriodCloses) {
71 [controller_ showWindow:nil]; 73 [controller_ showWindow:nil];
72 EXPECT_TRUE([window_ isVisible]); 74 EXPECT_TRUE([window_ isVisible]);
73 75
74 [window_ performKeyEquivalent:cocoa_test_event_utils::KeyEventWithKeyCode( 76 [window_ performKeyEquivalent:cocoa_test_event_utils::KeyEventWithKeyCode(
75 kVK_ANSI_Period, '.', NSKeyDown, 77 kVK_ANSI_Period, '.', NSKeyDown,
76 NSCommandKeyMask)]; 78 NSCommandKeyMask)];
77 EXPECT_FALSE([window_ isVisible]); 79 EXPECT_FALSE([window_ isVisible]);
78 } 80 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/info_bubble_window.mm ('k') | chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698