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

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

Issue 402066: Moved a whole pile of unittests over to CocoaTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/toolbar_view_unittest.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/web_drop_target_unittest.mm
===================================================================
--- chrome/browser/cocoa/web_drop_target_unittest.mm (revision 32421)
+++ chrome/browser/cocoa/web_drop_target_unittest.mm (working copy)
@@ -13,15 +13,12 @@
class WebDropTargetTest : public RenderViewHostTestHarness {
public:
- WebDropTargetTest() {
- drop_target_.reset([[WebDropTarget alloc] initWithTabContents:contents()]);
+ virtual void SetUp() {
+ RenderViewHostTestHarness::SetUp();
+ CocoaTest::BootstrapCocoa();
+ drop_target_.reset([[WebDropTarget alloc] initWithTabContents:contents()]);
}
- virtual ~WebDropTargetTest() {
- RenderViewHostTestHarness::TearDown();
-
- }
-
void PutURLOnPasteboard(NSString* urlString, NSPasteboard* pboard) {
[pboard declareTypes:[NSArray arrayWithObject:NSURLPboardType]
owner:nil];
@@ -31,7 +28,6 @@
}
base::ScopedNSAutoreleasePool pool_;
- CocoaTestHelper cocoa_helper_;
scoped_nsobject<WebDropTarget> drop_target_;
};
@@ -43,12 +39,13 @@
// Test flipping of coordinates given a point in window coordinates.
TEST_F(WebDropTargetTest, Flip) {
NSPoint windowPoint = NSZeroPoint;
+ scoped_nsobject<NSWindow> window([[CocoaTestHelperWindow alloc] init]);
NSPoint viewPoint =
[drop_target_ flipWindowPointToView:windowPoint
- view:cocoa_helper_.contentView()];
+ view:[window contentView]];
NSPoint screenPoint =
[drop_target_ flipWindowPointToScreen:windowPoint
- view:cocoa_helper_.contentView()];
+ view:[window contentView]];
EXPECT_EQ(viewPoint.x, 0);
EXPECT_EQ(viewPoint.y, 600);
EXPECT_EQ(screenPoint.x, 0);
« no previous file with comments | « chrome/browser/cocoa/toolbar_view_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698