summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_unittest_helper.mm
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 17:11:02 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 17:11:02 +0000
commit4ac884b18f10f3ae3a5daafbfa25f4545dd401ce (patch)
treedaca6e7903d29ccf169723a88265574f1fa90d29 /chrome/browser/cocoa/bookmark_bar_unittest_helper.mm
parentb808eb6f0f47a7c4ad15dd8ec115404ce14b47b6 (diff)
downloadchromium_src-4ac884b18f10f3ae3a5daafbfa25f4545dd401ce.zip
chromium_src-4ac884b18f10f3ae3a5daafbfa25f4545dd401ce.tar.gz
chromium_src-4ac884b18f10f3ae3a5daafbfa25f4545dd401ce.tar.bz2
Implement drag from bookmark manager to bookmark bar or a folder thereof. Implement drag of other bookmark and URL sources such as from the Desktop or a text selection.
BUG=39884,44228 TEST=Note: For all drag operations verify that the appropriate drop indicator is presented while dragging. When dragging onto a bookmark bar folder the folder button should be highlighted and, after a short delay, open into a menu. When dragging between folders or on top of a non-folder bookmark an insertion bar (vertical when in the bookmark bar, horizontal when in a folder menu) should be presented. For 'copy' moves the drag image should be adorned with a plus sign in a green circle. A non-copy move should show no such tag. 1) Drag a non-folder bookmark from the bookmark manager to the bookmark bar such that it falls on a non-folder bookmark. Verify that the bookmark is moved to be on the bar just before the bookmark upon which is was dropped. 2) Drag a folder bookmark from the manager to the bookmark bar such that it falls on a non-folder bookmark. Verify that the folder (as a folder) is moved to be on the bar just before the bookmark upon which is was dropped. 3) Drag a bookmark from the manager to a folder on the bookmark bar. Verify that the bookmark is added to the folder at the end and removed from the old location in the manager. 4) Drag a bookmark from the manager to a folder on the bookmark bar and wait for the folder to open and then drag to within the folder. Verify that dropping places the bookmark and removes it from the old location in the manager. 5) Drag a bookmark from the bar to the manager and verify that the manager now shows the dragged bookmark. (Note that this should be a 'move' but is currently a 'copy'. See http://crbug.com/44039.) 6) Drag a bookmark clipping from the Finder Desktop to the bookmark bar. Verify that it is added to the bar as a new bookmark. 7) Drag a bookmark clipping from the Finder Desktop to a folder on the bookmark bar and drop it within the folder menu. Verify that it is added to the folder as a new bookmark. 8) Create a URL in TextEdit or Stickies, select it and drag to the bookmark bar. Verify that it is added to the bar. 9) Create a URL in TextEdit or Stickies, select it and drag to a folder on the bookmark bar and drop it within the folder menu. Verify that it is added to the folder. Review URL: http://codereview.chromium.org/2066001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47523 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_unittest_helper.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_unittest_helper.mm14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_unittest_helper.mm b/chrome/browser/cocoa/bookmark_bar_unittest_helper.mm
index 114197e..5453057 100644
--- a/chrome/browser/cocoa/bookmark_bar_unittest_helper.mm
+++ b/chrome/browser/cocoa/bookmark_bar_unittest_helper.mm
@@ -57,6 +57,13 @@
return top;
}
+- (NSPoint)bottom {
+ NSRect frame = [self frame];
+ NSPoint bottom = NSMakePoint(NSMidX(frame), NSMinY(frame));
+ bottom = [[self superview] convertPoint:bottom toView:nil];
+ return bottom;
+}
+
- (NSPoint)left {
NSRect frame = [self frame];
NSPoint left = NSMakePoint(NSMinX(frame), NSMidY(frame));
@@ -64,4 +71,11 @@
return left;
}
+- (NSPoint)right {
+ NSRect frame = [self frame];
+ NSPoint right = NSMakePoint(NSMaxX(frame), NSMidY(frame));
+ right = [[self superview] convertPoint:right toView:nil];
+ return right;
+}
+
@end