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.h" | 7 #include "chrome/browser/bookmarks/bookmark_model.h" |
8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 8 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" |
11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 11 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| 12 #include "chrome/test/base/testing_profile.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
13 #include "testing/platform_test.h" | 14 #include "testing/platform_test.h" |
14 #import "ui/base/test/cocoa_test_event_utils.h" | 15 #import "ui/base/test/cocoa_test_event_utils.h" |
15 | 16 |
16 // Fake BookmarkButton delegate to get a pong on mouse entered/exited | 17 // Fake BookmarkButton delegate to get a pong on mouse entered/exited |
17 @interface FakeButtonDelegate : NSObject<BookmarkButtonDelegate> { | 18 @interface FakeButtonDelegate : NSObject<BookmarkButtonDelegate> { |
18 @public | 19 @public |
19 int entered_; | 20 int entered_; |
20 int exited_; | 21 int exited_; |
21 BOOL canDragToTrash_; | 22 BOOL canDragToTrash_; |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 168 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
168 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationCopy]; | 169 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationCopy]; |
169 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 170 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
170 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationMove]; | 171 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationMove]; |
171 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 172 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
172 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationDelete]; | 173 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationDelete]; |
173 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); | 174 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); |
174 } | 175 } |
175 | 176 |
176 } | 177 } |
OLD | NEW |