OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | |
22 @interface BookmarkBarController (BookmarkBarUnitTestHelper) | 15 @interface BookmarkBarController (BookmarkBarUnitTestHelper) |
23 | 16 |
24 // Return the bookmark button from this bar controller with the given | 17 // Return the bookmark button from this bar controller with the given |
25 // |title|, otherwise nil. This does not recurse into folders. | 18 // |title|, otherwise nil. This does not recurse into folders. |
26 - (BookmarkButton*)buttonWithTitleEqualTo:(NSString*)title; | 19 - (BookmarkButton*)buttonWithTitleEqualTo:(NSString*)title; |
27 | 20 |
28 @end | 21 @end |
29 | 22 |
30 | 23 |
| 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 |
31 @interface BookmarkButton (BookmarkBarUnitTestHelper) | 33 @interface BookmarkButton (BookmarkBarUnitTestHelper) |
32 | 34 |
33 // Return the center of the button in the base coordinate system of the | 35 // Return the center of the button in the base coordinate system of the |
34 // containing window. Useful for simulating mouse clicks or drags. | 36 // containing window. Useful for simulating mouse clicks or drags. |
35 - (NSPoint)center; | 37 - (NSPoint)center; |
36 | 38 |
37 // Return the top of the button in the base coordinate system of the | 39 // Return the top of the button in the base coordinate system of the |
38 // containing window. | 40 // containing window. |
39 - (NSPoint)top; | 41 - (NSPoint)top; |
40 | 42 |
41 // Return the bottom of the button in the base coordinate system of the | 43 // Return the bottom of the button in the base coordinate system of the |
42 // containing window. | 44 // containing window. |
43 - (NSPoint)bottom; | 45 - (NSPoint)bottom; |
44 | 46 |
45 // Return the center-left point of the button in the base coordinate system | 47 // Return the center-left point of the button in the base coordinate system |
46 // of the containing window. | 48 // of the containing window. |
47 - (NSPoint)left; | 49 - (NSPoint)left; |
48 | 50 |
49 // Return the center-right point of the button in the base coordinate system | 51 // Return the center-right point of the button in the base coordinate system |
50 // of the containing window. | 52 // of the containing window. |
51 - (NSPoint)right; | 53 - (NSPoint)right; |
52 | 54 |
53 @end | 55 @end |
54 | 56 |
55 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_ | 57 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_ |
OLD | NEW |