OLD | NEW |
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" |
11 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
12 #include "components/bookmarks/browser/bookmark_model.h" | 12 #include "components/bookmarks/browser/bookmark_model.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
15 #import "ui/events/test/cocoa_test_event_utils.h" | 15 #import "ui/events/test/cocoa_test_event_utils.h" |
16 | 16 |
17 using bookmarks::BookmarkModel; | 17 using bookmarks::BookmarkModel; |
| 18 using bookmarks::BookmarkNode; |
18 | 19 |
19 // Fake BookmarkButton delegate to get a pong on mouse entered/exited | 20 // Fake BookmarkButton delegate to get a pong on mouse entered/exited |
20 @interface FakeButtonDelegate : NSObject<BookmarkButtonDelegate> { | 21 @interface FakeButtonDelegate : NSObject<BookmarkButtonDelegate> { |
21 @public | 22 @public |
22 int entered_; | 23 int entered_; |
23 int exited_; | 24 int exited_; |
24 BOOL canDragToTrash_; | 25 BOOL canDragToTrash_; |
25 int didDragToTrashCount_; | 26 int didDragToTrashCount_; |
26 } | 27 } |
27 @end | 28 @end |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 172 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
172 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationCopy]; | 173 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationCopy]; |
173 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 174 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
174 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationMove]; | 175 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationMove]; |
175 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 176 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
176 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationDelete]; | 177 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationDelete]; |
177 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); | 178 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); |
178 } | 179 } |
179 | 180 |
180 } | 181 } |
OLD | NEW |