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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm

Issue 1854223002: mac: Fix bookmark drag and drop. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp37_dnd
Patch Set: Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "base/mac/scoped_nsobject.h" 5 #include "base/mac/scoped_nsobject.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" 8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h"
10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h"
(...skipping 11 matching lines...) Expand all
22 @public 22 @public
23 int entered_; 23 int entered_;
24 int exited_; 24 int exited_;
25 BOOL canDragToTrash_; 25 BOOL canDragToTrash_;
26 int didDragToTrashCount_; 26 int didDragToTrashCount_;
27 } 27 }
28 @end 28 @end
29 29
30 @implementation FakeButtonDelegate 30 @implementation FakeButtonDelegate
31 31
32 - (void)fillPasteboard:(NSPasteboard*)pboard 32 - (NSPasteboardItem*)pasteboardItemForDragOfButton:(BookmarkButton*)button {
33 forDragOfButton:(BookmarkButton*)button {
34 } 33 }
35 34
36 - (void)mouseEnteredButton:(id)buton event:(NSEvent*)event { 35 - (void)mouseEnteredButton:(id)buton event:(NSEvent*)event {
37 entered_++; 36 entered_++;
38 } 37 }
39 38
40 - (void)mouseExitedButton:(id)buton event:(NSEvent*)event { 39 - (void)mouseExitedButton:(id)buton event:(NSEvent*)event {
41 exited_++; 40 exited_++;
42 } 41 }
43 42
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 operation:NSDragOperationMove]; 189 operation:NSDragOperationMove];
191 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); 190 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_);
192 [button draggingSession:nil 191 [button draggingSession:nil
193 endedAtPoint:NSZeroPoint 192 endedAtPoint:NSZeroPoint
194 operation:NSDragOperationDelete]; 193 operation:NSDragOperationDelete];
195 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); 194 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_);
196 #pragma clang diagnostic pop 195 #pragma clang diagnostic pop
197 } 196 }
198 197
199 } 198 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698