Home | History | Annotate | Download | only in bookmarks
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef 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
      8 
      9 #import <Foundation/Foundation.h>
     10 
     11 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
     12 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.h"
     13 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
     14 
     15 @interface BookmarkBarController (BookmarkBarUnitTestHelper)
     16 
     17 // Return the bookmark button from this bar controller with the given
     18 // |title|, otherwise nil. This does not recurse into folders.
     19 - (BookmarkButton*)buttonWithTitleEqualTo:(NSString*)title;
     20 
     21 @end
     22 
     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 
     33 @interface BookmarkButton (BookmarkBarUnitTestHelper)
     34 
     35 // Return the center of the button in the base coordinate system of the
     36 // containing window. Useful for simulating mouse clicks or drags.
     37 - (NSPoint)center;
     38 
     39 // Return the top of the button in the base coordinate system of the
     40 // containing window.
     41 - (NSPoint)top;
     42 
     43 // Return the bottom of the button in the base coordinate system of the
     44 // containing window.
     45 - (NSPoint)bottom;
     46 
     47 // Return the center-left point of the button in the base coordinate system
     48 // of the containing window.
     49 - (NSPoint)left;
     50 
     51 // Return the center-right point of the button in the base coordinate system
     52 // of the containing window.
     53 - (NSPoint)right;
     54 
     55 @end
     56 
     57 #endif  // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_UNITTEST_HELPER_H_
     58