| 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/core/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 // Fake BookmarkButton delegate to get a pong on mouse entered/exited | 17 // Fake BookmarkButton delegate to get a pong on mouse entered/exited |
| 18 @interface FakeButtonDelegate : NSObject<BookmarkButtonDelegate> { | 18 @interface FakeButtonDelegate : NSObject<BookmarkButtonDelegate> { |
| 19 @public | 19 @public |
| 20 int entered_; | 20 int entered_; |
| 21 int exited_; | 21 int exited_; |
| 22 BOOL canDragToTrash_; | 22 BOOL canDragToTrash_; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 169 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
| 170 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationCopy]; | 170 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationCopy]; |
| 171 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 171 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
| 172 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationMove]; | 172 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationMove]; |
| 173 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 173 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
| 174 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationDelete]; | 174 [button draggedImage:nil endedAt:NSZeroPoint operation:NSDragOperationDelete]; |
| 175 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); | 175 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } | 178 } |
| OLD | NEW |