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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.mm

Issue 7465090: [Mac] Replace the custom bookmark menus with native NSMenus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.mm
index 7cddec48a9e3b0778934f41b446b993b3e7234d6..56303f0efecafc1109f810a7e34babe1060a496c 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.mm
@@ -1,9 +1,27 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_unittest_helper.h"
+#import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h"
+#include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
+
+NSUInteger GetNumberOfMenuItems(BookmarkBarFolderController* folder) {
+ if (![folder menuBridge])
+ return 0;
+ return [[[[folder menuBridge]->controller() menu] itemArray] count];
+}
+
+void CloseFolderSoon(BookmarkBarFolderController* folder, NSTimeInterval when) {
+ NSArray* modes = [NSArray arrayWithObjects:NSDefaultRunLoopMode,
+ NSEventTrackingRunLoopMode, nil];
+ [folder performSelector:@selector(closeMenu)
+ withObject:nil
+ afterDelay:when
+ inModes:modes];
+}
+
@interface NSArray (BookmarkBarUnitTestHelper)
// A helper function for scanning an array of buttons looking for the
@@ -33,14 +51,6 @@
@end
-@implementation BookmarkBarFolderController(BookmarkBarUnitTestHelper)
-
-- (BookmarkButton*)buttonWithTitleEqualTo:(NSString*)title {
- return [[self buttons] buttonWithTitleEqualTo:title];
-}
-
-@end
-
@implementation BookmarkButton(BookmarkBarUnitTestHelper)
- (NSPoint)center {

Powered by Google App Engine
This is Rietveld 408576698