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

Unified Diff: chrome/browser/cocoa/bookmark_button_unittest.mm

Issue 180036: Make download items drag sources on OS X. (Closed)
Patch Set: comments Created 10 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/bookmark_button.mm ('k') | chrome/browser/cocoa/download_item_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_button_unittest.mm
diff --git a/chrome/browser/cocoa/bookmark_button_unittest.mm b/chrome/browser/cocoa/bookmark_button_unittest.mm
index fcdf528e119fbc1a493561695dd47ada796ffb48..5ec87bdfdc64f78ecc568ced89df1c6895dd9bd2 100644
--- a/chrome/browser/cocoa/bookmark_button_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_button_unittest.mm
@@ -12,38 +12,8 @@ class BookmarkButtonTest : public CocoaTest {
public:
};
-NSEvent* Event(const NSPoint point, const NSEventType type) {
- static NSUInteger eventNumber = 0; // thx shess
- return [NSEvent mouseEventWithType:type
- location:point
- modifierFlags:0
- timestamp:0
- windowNumber:183 // picked out of thin air.
- context:nil
- eventNumber:eventNumber++
- clickCount:1
- pressure:0.0];
-}
-
-// Make sure the basic case of "click" still works.
-TEST_F(BookmarkButtonTest, DownUp) {
- scoped_nsobject<NSMutableArray> array;
- array.reset([[NSMutableArray alloc] init]);
- [array addObject:@"foo"];
- [array addObject:@"bar"];
-
+// Make sure nothing leaks
+TEST_F(BookmarkButtonTest, Create) {
scoped_nsobject<BookmarkButton> button;
button.reset([[BookmarkButton alloc] initWithFrame:NSMakeRect(0,0,500,500)]);
-
- [button setTarget:array.get()];
- [button setAction:@selector(removeAllObjects)];
- EXPECT_FALSE([[button cell] isHighlighted]);
-
- NSEvent* downEvent(Event(NSMakePoint(10,10), NSLeftMouseDown));
- NSEvent* upEvent(Event(NSMakePoint(10,10), NSLeftMouseDown));
- [button mouseDown:downEvent];
- EXPECT_TRUE([[button cell] isHighlighted]);
- [button mouseUp:upEvent];
- EXPECT_FALSE([[button cell] isHighlighted]);
- EXPECT_FALSE([array count]); // confirms target/action fired
}
« no previous file with comments | « chrome/browser/cocoa/bookmark_button.mm ('k') | chrome/browser/cocoa/download_item_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698