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

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

Issue 1256183004: Fixed crashed when activating the context menu for toolbar buttons using Voiceover (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed indentation. Created 5 years, 4 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
« no previous file with comments | « chrome/browser/ui/cocoa/menu_button.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/mac/scoped_nsobject.h" 5 #include "base/mac/scoped_nsobject.h"
6 #import "chrome/browser/ui/cocoa/clickhold_button_cell.h" 6 #import "chrome/browser/ui/cocoa/clickhold_button_cell.h"
7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" 7 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
8 #import "chrome/browser/ui/cocoa/menu_button.h" 8 #import "chrome/browser/ui/cocoa/menu_button.h"
9 9
10 @interface MenuButtonTestDelegate : NSObject<NSMenuDelegate> { 10 @interface MenuButtonTestDelegate : NSObject<NSMenuDelegate> {
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 // Command to open the menu should not be available. 240 // Command to open the menu should not be available.
241 NSArray* actionNames = [buttonCell accessibilityActionNames]; 241 NSArray* actionNames = [buttonCell accessibilityActionNames];
242 EXPECT_FALSE([actionNames containsObject:NSAccessibilityShowMenuAction]); 242 EXPECT_FALSE([actionNames containsObject:NSAccessibilityShowMenuAction]);
243 243
244 [button_ setOpenMenuOnRightClick:YES]; 244 [button_ setOpenMenuOnRightClick:YES];
245 245
246 // Command to open the menu should now become available. 246 // Command to open the menu should now become available.
247 actionNames = [buttonCell accessibilityActionNames]; 247 actionNames = [buttonCell accessibilityActionNames];
248 EXPECT_TRUE([actionNames containsObject:NSAccessibilityShowMenuAction]); 248 EXPECT_TRUE([actionNames containsObject:NSAccessibilityShowMenuAction]);
249 249
250 [button_ setOpenMenuOnClick:NO];
251
252 // Command should still be available, even when both click + hold and right
253 // click are turned on.
254 actionNames = [buttonCell accessibilityActionNames];
255 EXPECT_TRUE([actionNames containsObject:NSAccessibilityShowMenuAction]);
256
250 [buttonCell accessibilityPerformAction:NSAccessibilityShowMenuAction]; 257 [buttonCell accessibilityPerformAction:NSAccessibilityShowMenuAction];
251 EXPECT_TRUE([delegate didOpen]); 258 EXPECT_TRUE([delegate didOpen]);
252 EXPECT_FALSE([delegate isOpen]); 259 EXPECT_FALSE([delegate isOpen]);
253 } 260 }
254 261
255 } // namespace 262 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/menu_button.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698