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

Side by Side Diff: chrome/browser/cocoa/bookmark_bar_view_unittest.mm

Issue 437066: Merge 33079 - Mac: give visual feedback for bookmark button drags.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_view.mm ('k') | chrome/browser/cocoa/bookmark_button.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/scoped_nsobject.h" 5 #include "base/scoped_nsobject.h"
6 #import "chrome/browser/cocoa/bookmark_bar_view.h" 6 #import "chrome/browser/cocoa/bookmark_bar_view.h"
7 #import "chrome/browser/cocoa/bookmark_button.h" 7 #import "chrome/browser/cocoa/bookmark_button.h"
8 #import "chrome/browser/cocoa/cocoa_test_helper.h" 8 #import "chrome/browser/cocoa/cocoa_test_helper.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 - (BOOL)dragButton:(BookmarkButton*)button to:(NSPoint)point { 53 - (BOOL)dragButton:(BookmarkButton*)button to:(NSPoint)point {
54 pong_ = YES; 54 pong_ = YES;
55 return YES; 55 return YES;
56 } 56 }
57 57
58 // Confirm the pong. 58 // Confirm the pong.
59 - (BOOL)dragButtonToPong { 59 - (BOOL)dragButtonToPong {
60 return pong_; 60 return pong_;
61 } 61 }
62 62
63 - (CGFloat)indicatorPosForDragOfButton:(BookmarkButton*)sourceButton
64 toPoint:(NSPoint)point {
65 return 0;
66 }
67
63 @end 68 @end
64 69
65 namespace { 70 namespace {
66 71
67 class BookmarkBarViewTest : public CocoaTest { 72 class BookmarkBarViewTest : public CocoaTest {
68 public: 73 public:
69 scoped_nsobject<BookmarkBarView> view_; 74 scoped_nsobject<BookmarkBarView> view_;
70 }; 75 };
71 76
72 TEST_F(BookmarkBarViewTest, CanDragWindow) { 77 TEST_F(BookmarkBarViewTest, CanDragWindow) {
73 view_.reset([[BookmarkBarView alloc] init]); 78 view_.reset([[BookmarkBarView alloc] init]);
74 EXPECT_FALSE([view_.get() mouseDownCanMoveWindow]); 79 EXPECT_FALSE([view_.get() mouseDownCanMoveWindow]);
75 } 80 }
76 81
77 TEST_F(BookmarkBarViewTest, BookmarkButtonDragAndDrop) { 82 TEST_F(BookmarkBarViewTest, BookmarkButtonDragAndDrop) {
78 view_.reset([[BookmarkBarView alloc] init]); 83 view_.reset([[BookmarkBarView alloc] init]);
79 scoped_nsobject<FakeBookmarkDraggingInfo> 84 scoped_nsobject<FakeBookmarkDraggingInfo>
80 info([[FakeBookmarkDraggingInfo alloc] init]); 85 info([[FakeBookmarkDraggingInfo alloc] init]);
81 86
82 [view_ setController:info.get()]; 87 [view_ setController:info.get()];
83 EXPECT_EQ([view_ draggingEntered:(id)info.get()], NSDragOperationMove); 88 EXPECT_EQ([view_ draggingEntered:(id)info.get()], NSDragOperationMove);
84 EXPECT_TRUE([view_ performDragOperation:(id)info.get()]); 89 EXPECT_TRUE([view_ performDragOperation:(id)info.get()]);
85 EXPECT_TRUE([info dragButtonToPong]); 90 EXPECT_TRUE([info dragButtonToPong]);
86 } 91 }
87 92
88 } // namespace 93 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_view.mm ('k') | chrome/browser/cocoa/bookmark_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698