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

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

Issue 7048009: [Mac] Fix "No drag (+) cursor displayed when dragging link over BMB" (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 7 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
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm (revision 86655)
+++ chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm (working copy)
@@ -27,6 +27,7 @@
BOOL draggingEnteredCalled_;
// Only mock one type of drag data at a time.
NSString* dragDataType_;
+ id draggingSource_;
}
@property (nonatomic) BOOL dropIndicatorShown;
@property (nonatomic) BOOL draggingEnteredCalled;
@@ -59,8 +60,13 @@
dragBookmarkDataPong_ = NO;
dropIndicatorShown_ = YES;
draggingEnteredCalled_ = NO;
+ draggingSource_ = self;
}
+- (void)setDraggingSource:(id)draggingSource {
+ draggingSource_ = draggingSource;
+}
+
// NSDragInfo mocking functions.
- (id)draggingPasteboard {
@@ -69,7 +75,7 @@
// So we can look local.
- (id)draggingSource {
- return self;
+ return draggingSource_;
}
- (NSDragOperation)draggingSourceOperationMask {
@@ -182,6 +188,8 @@
[view_ setController:info.get()];
[info reset];
+ scoped_nsobject<BookmarkButton> dragged_button([[BookmarkButton alloc] init]);
+ [info setDraggingSource:dragged_button.get()];
[info setDragDataType:kBookmarkButtonDragType];
EXPECT_EQ([view_ draggingEntered:(id)info.get()], NSDragOperationMove);
EXPECT_TRUE([view_ performDragOperation:(id)info.get()]);
@@ -199,7 +207,7 @@
NSArray* dragTypes = [URLDropTargetHandler handledDragTypes];
for (NSString* type in dragTypes) {
[info setDragDataType:type];
- EXPECT_EQ([view_ draggingEntered:(id)info.get()], NSDragOperationMove);
+ EXPECT_EQ([view_ draggingEntered:(id)info.get()], NSDragOperationCopy);
EXPECT_TRUE([view_ performDragOperation:(id)info.get()]);
EXPECT_FALSE([info dragButtonToPong]);
EXPECT_TRUE([info dragURLsPong]);
@@ -212,8 +220,10 @@
scoped_nsobject<FakeBookmarkDraggingInfo>
info([[FakeBookmarkDraggingInfo alloc] init]);
[view_ setController:info.get()];
+ [info reset];
- [info reset];
+ scoped_nsobject<BookmarkButton> dragged_button([[BookmarkButton alloc] init]);
+ [info setDraggingSource:dragged_button.get()];
[info setDragDataType:kBookmarkButtonDragType];
EXPECT_FALSE([info draggingEnteredCalled]);
EXPECT_EQ([view_ draggingEntered:(id)info.get()], NSDragOperationMove);
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698