| OLD | NEW |
| 1 // Copyright (c) 2010 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 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 | 10 |
| 11 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 11 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 12 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h" | 12 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h" |
| 13 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 13 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
| 14 | 14 |
| 15 // Returns the number of items in a given bookmark folder |
| 16 NSUInteger NumberOfMenuItems(BookmarkBarFolderController* folder); |
| 17 |
| 18 // Closes a bookmark menu folder after some delay. |
| 19 void CloseFolderAfterDelay(BookmarkBarFolderController* folder, |
| 20 NSTimeInterval delay); |
| 21 |
| 15 @interface BookmarkBarController (BookmarkBarUnitTestHelper) | 22 @interface BookmarkBarController (BookmarkBarUnitTestHelper) |
| 16 | 23 |
| 17 // Return the bookmark button from this bar controller with the given | 24 // Return the bookmark button from this bar controller with the given |
| 18 // |title|, otherwise nil. This does not recurse into folders. | 25 // |title|, otherwise nil. This does not recurse into folders. |
| 19 - (BookmarkButton*)buttonWithTitleEqualTo:(NSString*)title; | 26 - (BookmarkButton*)buttonWithTitleEqualTo:(NSString*)title; |
| 20 | 27 |
| 21 @end | 28 @end |
| 22 | 29 |
| 23 | 30 |
| 24 @interface BookmarkBarFolderController (BookmarkBarUnitTestHelper) | |
| 25 | |
| 26 // Return the bookmark button from this folder controller with the given | |
| 27 // |title|, otherwise nil. This does not recurse into subfolders. | |
| 28 - (BookmarkButton*)buttonWithTitleEqualTo:(NSString*)title; | |
| 29 | |
| 30 @end | |
| 31 | |
| 32 | |
| 33 @interface BookmarkButton (BookmarkBarUnitTestHelper) | 31 @interface BookmarkButton (BookmarkBarUnitTestHelper) |
| 34 | 32 |
| 35 // Return the center of the button in the base coordinate system of the | 33 // Return the center of the button in the base coordinate system of the |
| 36 // containing window. Useful for simulating mouse clicks or drags. | 34 // containing window. Useful for simulating mouse clicks or drags. |
| 37 - (NSPoint)center; | 35 - (NSPoint)center; |
| 38 | 36 |
| 39 // Return the top of the button in the base coordinate system of the | 37 // Return the top of the button in the base coordinate system of the |
| 40 // containing window. | 38 // containing window. |
| 41 - (NSPoint)top; | 39 - (NSPoint)top; |
| 42 | 40 |
| 43 // Return the bottom of the button in the base coordinate system of the | 41 // Return the bottom of the button in the base coordinate system of the |
| 44 // containing window. | 42 // containing window. |
| 45 - (NSPoint)bottom; | 43 - (NSPoint)bottom; |
| 46 | 44 |
| 47 // Return the center-left point of the button in the base coordinate system | 45 // Return the center-left point of the button in the base coordinate system |
| 48 // of the containing window. | 46 // of the containing window. |
| 49 - (NSPoint)left; | 47 - (NSPoint)left; |
| 50 | 48 |
| 51 // Return the center-right point of the button in the base coordinate system | 49 // Return the center-right point of the button in the base coordinate system |
| 52 // of the containing window. | 50 // of the containing window. |
| 53 - (NSPoint)right; | 51 - (NSPoint)right; |
| 54 | 52 |
| 55 @end | 53 @end |
| 56 | 54 |
| 57 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_ | 55 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_ |
| OLD | NEW |