OLD | NEW |
1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 while ([bbfc canScrollDown]) { | 589 while ([bbfc canScrollDown]) { |
590 [bbfc performOneScroll:-scrollOneBookmark]; | 590 [bbfc performOneScroll:-scrollOneBookmark]; |
591 --buttonCounter; | 591 --buttonCounter; |
592 } | 592 } |
593 button = [buttons objectAtIndex:buttonCounter + 3]; | 593 button = [buttons objectAtIndex:buttonCounter + 3]; |
594 [folder deleteBookmark:button]; | 594 [folder deleteBookmark:button]; |
595 newTop = [menuWindow frame].origin.y + NSHeight([menuWindow frame]); | 595 newTop = [menuWindow frame].origin.y + NSHeight([menuWindow frame]); |
596 EXPECT_CGFLOAT_EQ(oldTop - bookmarks::kScrollWindowVerticalMargin, newTop); | 596 EXPECT_CGFLOAT_EQ(oldTop - bookmarks::kScrollWindowVerticalMargin, newTop); |
597 } | 597 } |
598 | 598 |
| 599 // Make sure that we return the correct browser window. |
| 600 TEST_F(BookmarkBarFolderControllerTest, BrowserWindow) { |
| 601 scoped_nsobject<BookmarkBarFolderController> controller( |
| 602 SimpleBookmarkBarFolderController()); |
| 603 EXPECT_EQ([bar_ browserWindow], [controller browserWindow]); |
| 604 } |
| 605 |
599 @interface FakedDragInfo : NSObject { | 606 @interface FakedDragInfo : NSObject { |
600 @public | 607 @public |
601 NSPoint dropLocation_; | 608 NSPoint dropLocation_; |
602 NSDragOperation sourceMask_; | 609 NSDragOperation sourceMask_; |
603 } | 610 } |
604 @property (nonatomic, assign) NSPoint dropLocation; | 611 @property (nonatomic, assign) NSPoint dropLocation; |
605 - (void)setDraggingSourceOperationMask:(NSDragOperation)mask; | 612 - (void)setDraggingSourceOperationMask:(NSDragOperation)mask; |
606 @end | 613 @end |
607 | 614 |
608 @implementation FakedDragInfo | 615 @implementation FakedDragInfo |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1562 [folder deleteBookmark:folder]; | 1569 [folder deleteBookmark:folder]; |
1563 EXPECT_FALSE([folder folderController]); | 1570 EXPECT_FALSE([folder folderController]); |
1564 } | 1571 } |
1565 | 1572 |
1566 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so | 1573 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so |
1567 // they are hard to test. Factor out "fire timers" into routines | 1574 // they are hard to test. Factor out "fire timers" into routines |
1568 // which can be overridden to fire immediately to make behavior | 1575 // which can be overridden to fire immediately to make behavior |
1569 // confirmable. | 1576 // confirmable. |
1570 // There is a similar problem with mouseEnteredButton: and | 1577 // There is a similar problem with mouseEnteredButton: and |
1571 // mouseExitedButton:. | 1578 // mouseExitedButton:. |
OLD | NEW |